aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-08-14 07:10:49 -0400
committerJunio C Hamano <gitster@pobox.com>2020-08-14 10:48:12 -0700
commit8dc3156373f4e02c1b1f657350ffae8ee94cbf44 (patch)
tree3c2fb13dce87ea41845b4e959a2be46b69e67551 /dir.c
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff)
downloadgit-8dc3156373f4e02c1b1f657350ffae8ee94cbf44.tar.gz
clear_pattern_list(): clear embedded hashmaps
Commit 96cc8ab531 (sparse-checkout: use hashmaps for cone patterns, 2019-11-21) added some auxiliary hashmaps to the pattern_list struct, but they're leaked when clear_pattern_list() is called. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 1045cc9c6f..a684ce0186 100644
--- a/dir.c
+++ b/dir.c
@@ -916,6 +916,8 @@ void clear_pattern_list(struct pattern_list *pl)
free(pl->patterns[i]);
free(pl->patterns);
free(pl->filebuf);
+ hashmap_free_entries(&pl->recursive_hashmap, struct pattern_entry, ent);
+ hashmap_free_entries(&pl->parent_hashmap, struct pattern_entry, ent);
memset(pl, 0, sizeof(*pl));
}