mirror of
https://github.com/git/git
synced 2024-11-05 04:53:18 +00:00
commit-reach: fix trivial memory leak when computing reachability
We don't free the local `stack` commit list that we use to compute reachability of multiple commits at once. Do so. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9642479a2b
commit
f30bfafcd4
2 changed files with 2 additions and 0 deletions
|
@ -1227,4 +1227,5 @@ void tips_reachable_from_bases(struct repository *r,
|
|||
done:
|
||||
free(commits);
|
||||
repo_clear_commit_marks(r, SEEN);
|
||||
free_commit_list(stack);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
Loading…
Reference in a new issue