summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/dir.c b/dir.c
index d153a63bbd..fd8aa7c40f 100644
--- a/dir.c
+++ b/dir.c
@@ -2730,11 +2730,8 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
return NULL;
}
- if (!dir->untracked->root) {
- const int len = sizeof(*dir->untracked->root);
- dir->untracked->root = xmalloc(len);
- memset(dir->untracked->root, 0, len);
- }
+ if (!dir->untracked->root)
+ FLEX_ALLOC_STR(dir->untracked->root, name, "");
/* Validate $GIT_DIR/info/exclude and core.excludesfile */
root = dir->untracked->root;