diff options
author | Jeff King <peff@peff.net> | 2023-10-03 23:26:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-04 00:28:23 +0300 |
commit | ec97ad120caad0c7366a19a6680d37e2b8c5107c (patch) | |
tree | 1a788bc077b0eb63b9d34dc32fa98aa97103a325 /commit-reach.c | |
parent | be4b578c69e0ac1d974ebc9163ff5793a018da8e (diff) |
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>
Diffstat (limited to 'commit-reach.c')
-rw-r--r-- | commit-reach.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/commit-reach.c b/commit-reach.c index 4b7c233fd4..a868a575ea 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -173,6 +173,7 @@ struct commit_list *get_octopus_merge_bases(struct commit_list *in) for (k = bases; k; k = k->next) end = k; } + free_commit_list(ret); ret = new_commits; } return ret; |