summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2019-08-26 02:01:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-26 17:53:25 (GMT)
commit9784f9732165bf01c039d7fae2f0fba9bd06a015 (patch)
tree8a761a1d0376abbf311ee7c76c6f11a9b71c61f7 /commit.c
parent75b2f01a0f642b39b0f29b6218515df9b5eb798e (diff)
downloadgit-9784f9732165bf01c039d7fae2f0fba9bd06a015.zip
git-9784f9732165bf01c039d7fae2f0fba9bd06a015.tar.gz
git-9784f9732165bf01c039d7fae2f0fba9bd06a015.tar.bz2
commit: free the right buffer in release_commit_memory
The index field in the commit object is used to find the buffer corresponding to that commit in the buffer_slab. Resetting it first means free_commit_buffer is not going to free the right buffer. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index 26ce077..b44e3be 100644
--- a/commit.c
+++ b/commit.c
@@ -365,8 +365,8 @@ struct object_id *get_commit_tree_oid(const struct commit *commit)
void release_commit_memory(struct parsed_object_pool *pool, struct commit *c)
{
set_commit_tree(c, NULL);
- c->index = 0;
free_commit_buffer(pool, c);
+ c->index = 0;
free_commit_list(c->parents);
c->object.parsed = 0;