t/helper: fix leaking buffer in "dump-untracked-cache"
We never release the local `struct strbuf base` buffer, thus leaking memory. Fix this leak. This leak is exposed by t7063, but plugging it alone does not make the whole test suite pass. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Nov 5, 2024 at 07:17 UTC
0bc0fcf0b27271722de4fac668658ad5318bec84
1 file changed
+2
t/helper/test-dump-untracked-cache.c
+2
@@ -68,5 +68,7 @@ int cmd__dump_untracked_cache(int ac UNUSED, const char **av UNUSED)
68
printf("flags %08x\n", uc->dir_flags);
69
if (uc->root)
70
dump(uc->root, &base);
71
+
72
+ strbuf_release(&base);
73
return 0;
74
}