Skip to content

Commit 9889cff

Browse files
committed
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
2 parents ada7c5f + 6347d64 commit 9889cff

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

dir.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,11 +2730,8 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
27302730
return NULL;
27312731
}
27322732

2733-
if (!dir->untracked->root) {
2734-
const int len = sizeof(*dir->untracked->root);
2735-
dir->untracked->root = xmalloc(len);
2736-
memset(dir->untracked->root, 0, len);
2737-
}
2733+
if (!dir->untracked->root)
2734+
FLEX_ALLOC_STR(dir->untracked->root, name, "");
27382735

27392736
/* Validate $GIT_DIR/info/exclude and core.excludesfile */
27402737
root = dir->untracked->root;

0 commit comments

Comments
 (0)