git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mktree: fix a memory leak in write_tree()
@ 2011-11-10  8:39 Liu Yuan
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Yuan @ 2011-11-10  8:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] mktree: fix a memory leak in write_tree()
@ 2011-11-10  9:04 Liu Yuan
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Yuan @ 2011-11-10  9:04 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] mktree: fix a memory leak in write_tree()
@ 2011-11-11  3:51 Liu Yuan
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Yuan @ 2011-11-11  3:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-11  3:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10  8:39 [PATCH] mktree: fix a memory leak in write_tree() Liu Yuan
  -- strict thread matches above, loose matches on Subject: below --
2011-11-10  9:04 Liu Yuan
2011-11-11  3:51 Liu Yuan

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).