From: Mike Hommey Date: Mon, 26 Aug 2019 02:01:37 +0000 (+0900) Subject: commit: free the right buffer in release_commit_memory X-Git-Tag: v2.24.0-rc0~120^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9784f9732165bf01c039d7fae2f0fba9bd06a015;p=git 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 --- 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;