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: Taylor Blau <me@ttaylorr.com>
This commit is contained in:
Patrick Steinhardt 2024-10-21 11:28:58 +02:00 committed by Taylor Blau
parent a4a3b8c7b4
commit 44cbc97229

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;
}