git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] fix minor memory leak in get_tree_entry()

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Feb 14, 2010, 09:56 UTC
Message-ID
<4B77C8DE.5070503@lsrfire.ath.cx>
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
Next: Jeff King
Message 1 of 2 in “fix minor memory leak in get_tree_entry()”
  1. fix minor memory leak in get_tree_entry()René Scharfe, Feb 14, 2010
  2. Jeff KingFeb 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.