Skip to content

Commit cc5b700

Browse files
pks-tttaylorr
authored andcommitted
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 <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent aee7700 commit cc5b700

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

t/helper/test-dump-untracked-cache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,7 @@ int cmd__dump_untracked_cache(int ac UNUSED, const char **av UNUSED)
6868
printf("flags %08x\n", uc->dir_flags);
6969
if (uc->root)
7070
dump(uc->root, &base);
71+
72+
strbuf_release(&base);
7173
return 0;
7274
}

0 commit comments

Comments
 (0)