git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix minor memory leak in get_tree_entry()
@ 2010-02-14  9:56 René Scharfe
  2010-02-15  4:43 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: René Scharfe @ 2010-02-14  9:56 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Jeff King

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 tree-walk.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tree-walk.c b/tree-walk.c
index 08796c2..67a9a0c 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -441,6 +441,7 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch
 
 	if (name[0] == '\0') {
 		hashcpy(sha1, root);
+		free(tree);
 		return 0;
 	}
 
-- 
1.7.0

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

* Re: [PATCH] fix minor memory leak in get_tree_entry()
  2010-02-14  9:56 [PATCH] fix minor memory leak in get_tree_entry() René Scharfe
@ 2010-02-15  4:43 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2010-02-15  4:43 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git Mailing List, Junio C Hamano

On Sun, Feb 14, 2010 at 10:56:46AM +0100, René Scharfe wrote:

> diff --git a/tree-walk.c b/tree-walk.c
> index 08796c2..67a9a0c 100644
> --- a/tree-walk.c
> +++ b/tree-walk.c
> @@ -441,6 +441,7 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch
>  
>  	if (name[0] == '\0') {
>  		hashcpy(sha1, root);
> +		free(tree);
>  		return 0;
>  	}

Oops. Good catch.

Acked-by: Jeff King <peff@peff.net>

-Peff

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

end of thread, other threads:[~2010-02-15  4:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-14  9:56 [PATCH] fix minor memory leak in get_tree_entry() René Scharfe
2010-02-15  4:43 ` Jeff King

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