aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-15 12:14:32 +0900
committerJunio C Hamano <gitster@pobox.com>2017-11-15 12:14:32 +0900
commit905f16dd02bb15e0c1e12bf1a6c28510f504f441 (patch)
tree30ca8d7c2c929bf8bd57d4a853e4c92e74ae1ddb /commit.c
parent093048b22913be23fe45635e8723d3aa3a185ff3 (diff)
parent4da72644b768b0491110a8ba0aa84d32b6bde41c (diff)
downloadgit-905f16dd02bb15e0c1e12bf1a6c28510f504f441.tar.gz
git-905f16dd02bb15e0c1e12bf1a6c28510f504f441.tar.xz
Merge branch 'ma/reduce-heads-leakfix'
Leak fixes. * ma/reduce-heads-leakfix: reduce_heads: fix memory leaks builtin/merge-base: free commit lists
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index 1e0e63379..cab8d4455 100644
--- a/commit.c
+++ b/commit.c
@@ -1090,6 +1090,13 @@ struct commit_list *reduce_heads(struct commit_list *heads)
return result;
}
+void reduce_heads_replace(struct commit_list **heads)
+{
+ struct commit_list *result = reduce_heads(*heads);
+ free_commit_list(*heads);
+ *heads = result;
+}
+
static const char gpg_sig_header[] = "gpgsig";
static const int gpg_sig_header_len = sizeof(gpg_sig_header) - 1;