From: Ingo Molnar Date: Thu, 14 Apr 2005 10:43:44 +0000 (+0200) Subject: [patch] git: cleanup in ls-tree.c X-Git-Tag: v0.99~590 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c599caca3ab7d5d66d7cadbbf589c2e4b5587d3e;p=git.git [patch] git: cleanup in ls-tree.c cleanup: this patch adds a free() to ls-tree.c. (Technically it's not a memory leak yet because the buffer is allocated once by the function and then the utility exits - but it's a tad cleaner to not leave such assumptions in the code, so that if someone reuses the function (or extends the utility to include a loop) the uncleanliness doesnt develop into a real memory leak.) Signed-off-by: Ingo Molnar Forward-ported. Signed-off-by: Petr Baudis --- diff --git a/ls-tree.c b/ls-tree.c index 7f8f8644a..4231c4b23 100644 --- a/ls-tree.c +++ b/ls-tree.c @@ -77,6 +77,7 @@ static int list(unsigned char *sha1) if (!buffer) die("unable to read sha1 file"); list_recursive(buffer, "tree", size, NULL); + free(buffer); return 0; }