]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/helper: fix leaking buffer in "dump-untracked-cache"
authorPatrick Steinhardt <ps@pks.im>
Tue, 5 Nov 2024 06:17:43 +0000 (07:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Nov 2024 06:37:56 +0000 (22:37 -0800)
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>
t/helper/test-dump-untracked-cache.c

index 4f010d53249520fb357d630b040cdfca21af6572..b2e70837a90a94d628a3d027fe28092a8ba348d9 100644 (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;
 }