aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-03-01 14:02:58 -0800
committerJunio C Hamano <gitster@pobox.com>2021-03-01 14:02:58 -0800
commit9889cff6d673b7dc2a699fa7f4470b2723e8d44a (patch)
tree3b8674149d08187e424eebfdfb63099b62e13541 /dir.c
parentada7c5fae5ba8c1fab4fc90131ae4058e0cb9271 (diff)
parent6347d649bcddf531f82d400103e23d99ea8f2fd4 (diff)
downloadgit-9889cff6d673b7dc2a699fa7f4470b2723e8d44a.tar.gz
Merge branch 'jh/untracked-cache-fix'
An under-allocation for the untracked cache data has been corrected. * jh/untracked-cache-fix: dir: fix malloc of root untracked_cache_dir
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;