From 3ff1fbbb9446e03050047a67247151887ee59e70 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 25 May 2005 18:27:14 -0700 Subject: commit: save the commit buffer off when parsing a commit object. A fair number of the users potentially want to look at the commit objects more closely, and if you worry about memory leaking in certain applications, you can always do a free(commit->buffer); commit->buffer = NULL; by hand after parsing them. --- commit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'commit.c') diff --git a/commit.c b/commit.c index b4e000e9c2..abbf155da9 100644 --- a/commit.c +++ b/commit.c @@ -103,6 +103,10 @@ int parse_commit(struct commit *item) sha1_to_hex(item->object.sha1)); } ret = parse_commit_buffer(item, buffer, size); + if (!ret) { + item->buffer = buffer; + return 0; + } free(buffer); return ret; } -- cgit v1.2.3