]> git.ipfire.org Git - thirdparty/git.git/commit
commit-reach: free temporary list in get_octopus_merge_bases()
authorJeff King <peff@peff.net>
Tue, 3 Oct 2023 20:26:30 +0000 (16:26 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Oct 2023 21:28:23 +0000 (14:28 -0700)
commitec97ad120caad0c7366a19a6680d37e2b8c5107c
tree1a788bc077b0eb63b9d34dc32fa98aa97103a325
parentbe4b578c69e0ac1d974ebc9163ff5793a018da8e
commit-reach: free temporary list in get_octopus_merge_bases()

We loop over the set of commits to merge, and for each one compute the
merge base against the existing set of merge base candidates we've
found. Then we replace the candidate set with a simple assignment of the
list head, leaking the old list. We should free it first before
assignment.

This makes t5521 leak-free, so mark it as such.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-reach.c
t/t5521-pull-options.sh