@matheusbsbs / matheus-bagliano / commits / 8dc3156373
Fork 0

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>

Jeff King committed Aug 14, 2020 at 07:10 UTC 8dc3156373f4e02c1b1f657350ffae8ee94cbf44
1 file changed +2
dir.c
+2
@@ -916,6 +916,8 @@ void clear_pattern_list(struct pattern_list *pl)
916 free(pl->patterns[i]);
917 free(pl->patterns);
918 free(pl->filebuf);
919 + hashmap_free_entries(&pl->recursive_hashmap, struct pattern_entry, ent);
920 + hashmap_free_entries(&pl->parent_hashmap, struct pattern_entry, ent);
921
922 memset(pl, 0, sizeof(*pl));
923 }