From 9784f9732165bf01c039d7fae2f0fba9bd06a015 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 26 Aug 2019 11:01:37 +0900 Subject: 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 Signed-off-by: Junio C Hamano --- commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commit.c') diff --git a/commit.c b/commit.c index 26ce0770f6..b44e3be8f6 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; -- cgit v1.2.1