Skip to content

Commit f30bfaf

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9642479 commit f30bfaf

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

commit-reach.c

+1
Original file line numberDiff line numberDiff line change
@@ -1227,4 +1227,5 @@ void tips_reachable_from_bases(struct repository *r,
12271227
done:
12281228
free(commits);
12291229
repo_clear_commit_marks(r, SEEN);
1230+
free_commit_list(stack);
12301231
}

t/t3201-branch-contains.sh

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67

78
test_expect_success setup '

0 commit comments

Comments
 (0)