From: Liu Yuan Date: Thu, 10 Nov 2011 08:39:22 +0000 (+0800) Subject: mktree: fix a memory leak in write_tree() X-Git-Tag: v1.7.8-rc2~1^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cd9519bd2c5c666cfb3ec219ee0b47c83f26f3fe;p=git.git mktree: fix a memory leak in write_tree() We forget to call strbuf_release to release the buf memory. Signed-off-by: Liu Yuan Signed-off-by: Junio C Hamano --- diff --git a/mktree.c b/mktree.c index 2e84889c0..bb23c4425 100644 --- a/mktree.c +++ b/mktree.c @@ -61,6 +61,7 @@ static void write_tree(unsigned char *sha1) } write_sha1_file(buf.buf, buf.len, tree_type, sha1); + strbuf_release(&buf); } static const char mktree_usage[] = "git-mktree [-z]";