test-tool ref-store: fix a memory leak

Fix a memory leak introduced in fa099d23227 (worktree.c: kill parse_ref() in favor of refs_resolve_ref_unsafe(), 2017-04-24), as a result we can mark another 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>

Ævar Arnfjörð Bjarmason committed Jul 1, 2022 at 12:37 UTC 34e691288d4e465fa457f6519ddbdc0f062a0619
1 file changed +1
t/helper/test-ref-store.c
+1
@@ -96,6 +96,7 @@ static const char **get_store(const char **argv, struct ref_store **refs)
96 die("no such worktree: %s", gitdir);
97
98 *refs = get_worktree_ref_store(*p);
99 + free_worktrees(worktrees);
100 } else
101 die("unknown backend %s", argv[0]);
102