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
@ -1227,4 +1227,5 @@ void tips_reachable_from_bases(struct repository *r,
|
|||||||
done:
|
done:
|
||||||
free(commits);
|
free(commits);
|
||||||
repo_clear_commit_marks(r, SEEN);
|
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_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
Loading…
Reference in New Issue
Block a user