aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-11-05 07:17:43 +0100
committerJunio C Hamano <gitster@pobox.com>2024-11-04 22:37:56 -0800
commit0bc0fcf0b27271722de4fac668658ad5318bec84 (patch)
tree6133262083c0a5dffd47c79f8f868d02b841e633
parenta53144cf1bfc5ef5b4d8b58311ea83e32e00a69f (diff)
downloadgit-0bc0fcf0b27271722de4fac668658ad5318bec84.tar.gz
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>
-rw-r--r--t/helper/test-dump-untracked-cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c
index 4f010d5324..b2e70837a9 100644
--- a/t/helper/test-dump-untracked-cache.c
+++ b/t/helper/test-dump-untracked-cache.c
@@ -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;
}