Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit: fix memory leak in `reduce_heads()`
author
Martin Ågren
<martin.agren@gmail.com>
Fri, 22 Sep 2017 23:34:50 +0000
(
01:34
+0200)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 24 Sep 2017 01:05:51 +0000
(10:05 +0900)
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>
commit.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
dd1055e
)
diff --git
a/commit.c
b/commit.c
index d3150d627071316accafb7d9c69b5988050f4a8e..f73976bcc9bafe6de3b7d91e12aff1308b0c9210 100644
(file)
--- 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;
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;
}
return result;
}