{"thread":{"id":"28904","subject":"[PATCH] mktree: fix a memory leak in write_tree()","startedAt":"2011-11-10T08:39:22Z","lastAt":"2011-11-10T08:39:22Z","messageCount":1,"participants":["Liu Yuan"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"179268","messageId":"1320914362-20417-1-git-send-email-namei.unix@gmail.com","threadId":"28904","inReplyTo":null,"subject":"[PATCH] mktree: fix a memory leak in write_tree()","fromName":"Liu Yuan","fromEmail":"namei.unix@gmail.com","sentAt":"2011-11-10T08:39:22Z","receivedAt":"2011-11-10T08:39:22Z","isPatch":true,"sender":{"key":"namei.unix@gmail.com","avatar":null},"body":"From: Liu Yuan <tailai.ly@taobao.com>\n\nWe forget to call strbuf_release to release the buf memory.\n\nSigned-off-by: Liu Yuan <tailai.ly@taobao.com>\n---\n builtin/mktree.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin/mktree.c b/builtin/mktree.c\nindex 098395f..4ae1c41 100644\n--- a/builtin/mktree.c\n+++ b/builtin/mktree.c\n@@ -60,6 +60,7 @@ static void write_tree(unsigned char *sha1)\n \t}\n \n \twrite_sha1_file(buf.buf, buf.len, tree_type, sha1);\n+\tstrbuf_release(&buf);\n }\n \n static const char *mktree_usage[] = {\n-- \n1.7.6.1\n"}]}