From: Liu Yuan <namei.unix@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] mktree: fix a memory leak in write_tree()
Date: Thu, 10 Nov 2011 16:39:22 +0800 [thread overview]
Message-ID: <1320914362-20417-1-git-send-email-namei.unix@gmail.com> (raw)
From: Liu Yuan <tailai.ly@taobao.com>
We forget to call strbuf_release to release the buf memory.
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
---
builtin/mktree.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/builtin/mktree.c b/builtin/mktree.c
index 098395f..4ae1c41 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -60,6 +60,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[] = {
--
1.7.6.1
next reply other threads:[~2011-11-10 8:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 8:39 Liu Yuan [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-11-10 9:04 [PATCH] mktree: fix a memory leak in write_tree() Liu Yuan
2011-11-11 3:51 Liu Yuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1320914362-20417-1-git-send-email-namei.unix@gmail.com \
--to=namei.unix@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).