diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-03-02 01:02:58 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-02 01:02:58 +0300 |
commit | 9889cff6d673b7dc2a699fa7f4470b2723e8d44a (patch) | |
tree | 3b8674149d08187e424eebfdfb63099b62e13541 /dir.c | |
parent | ada7c5fae5ba8c1fab4fc90131ae4058e0cb9271 (diff) | |
parent | 6347d649bcddf531f82d400103e23d99ea8f2fd4 (diff) |
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.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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; |