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>
This commit is contained in:
Patrick Steinhardt
2024-11-05 07:17:43 +01:00
committed by Junio C Hamano
parent a53144cf1b
commit 0bc0fcf0b2

View File

@@ -68,5 +68,7 @@ int cmd__dump_untracked_cache(int ac UNUSED, const char **av UNUSED)
printf("flags %08x\n", uc->dir_flags);
if (uc->root)
dump(uc->root, &base);
strbuf_release(&base);
return 0;
}