summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Yuan <tailai.ly@taobao.com>2011-11-10 16:39:22 +0800
committerJunio C Hamano <gitster@pobox.com>2011-11-10 09:04:08 -0800
commitcd9519bd2c5c666cfb3ec219ee0b47c83f26f3fe (patch)
tree2d16084aae0f522a201cb9842aced987e1560c79
parentd52bc66152834dff3fb5f32a54f6ed57730f58c6 (diff)
downloadgit-cd9519bd2c5c666cfb3ec219ee0b47c83f26f3fe.tar.gz
mktree: fix a memory leak in write_tree()
We forget to call strbuf_release to release the buf memory. Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--mktree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mktree.c b/mktree.c
index 2e84889c02..bb23c4425b 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]";