mirror of
https://github.com/git/git.git
synced 2024-09-30 16:01:40 +02:00
commit: fix memory leak in reduce_heads()
We don't free the temporary scratch space we use with `remove_redundant()`. Free it similar to how we do it in `get_merge_bases_many_0()`. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
dd1055ed59
commit
cb7b29eb67
1
commit.c
1
commit.c
@ -1080,6 +1080,7 @@ struct commit_list *reduce_heads(struct commit_list *heads)
|
||||
num_head = remove_redundant(array, num_head);
|
||||
for (i = 0; i < num_head; i++)
|
||||
tail = &commit_list_insert(array[i], tail)->next;
|
||||
free(array);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user