aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-scrap-cache-tree.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-07-01 12:37:34 +0200
committerJunio C Hamano <gitster@pobox.com>2022-07-01 13:38:49 -0700
commit9afa46d4a677c806f414f363daee07a9e6a44f0b (patch)
tree75ae5319e47c71b52d231c1844d56a0c5443af77 /t/helper/test-scrap-cache-tree.c
parenttest-tool path-utils: fix a memory leak (diff)
downloadgit-9afa46d4a677c806f414f363daee07a9e6a44f0b.tar.gz
git-9afa46d4a677c806f414f363daee07a9e6a44f0b.zip
test-tool {dump,scrap}-cache-tree: fix memory leaks
Fix memory leaks in two test-tools used by t0090-cache-tree.sh. As a result we can mark the test as passing with SANITIZE=leak using "TEST_PASSES_SANITIZE_LEAK=true". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-scrap-cache-tree.c')
-rw-r--r--t/helper/test-scrap-cache-tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c
index 393f1604ff..026c802479 100644
--- a/t/helper/test-scrap-cache-tree.c
+++ b/t/helper/test-scrap-cache-tree.c
@@ -12,6 +12,7 @@ int cmd__scrap_cache_tree(int ac, const char **av)
hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
if (read_cache() < 0)
die("unable to read index file");
+ cache_tree_free(&active_cache_tree);
active_cache_tree = NULL;
if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
die("unable to write index file");