From cb7b29eb67772d08e2365ed07ede9d954d0344c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C3=85gren?= Date: Sat, 23 Sep 2017 01:34:50 +0200 Subject: commit: fix memory leak in `reduce_heads()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- commit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'commit.c') diff --git a/commit.c b/commit.c index d3150d6270..f73976bcc9 100644 --- a/commit.c +++ b/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; } -- cgit v1.2.1