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

[PATCH] cache_tree_free: Fix small memory leak

From
Elijah Newren <newren@gmail.com>
Date
Sep 6, 2010, 21:40 UTC
Message-ID
<1283809216-26867-1-git-send-email-newren@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 cache-tree.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/cache-tree.c b/cache-tree.c
index c60cf91..f755590 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -22,8 +22,10 @@ void cache_tree_free(struct cache_tree **it_p)
 	if (!it)
 		return;
 	for (i = 0; i < it->subtree_nr; i++)
-		if (it->down[i])
+		if (it->down[i]) {
 			cache_tree_free(&it->down[i]->cache_tree);
+			free(it->down[i]);
+		}
 	free(it->down);
 	free(it);
 	*it_p = NULL;
-- 
1.7.2.3.5.g2c13
Message 1 of 1 in “cache_tree_free: Fix small memory leak”
  1. cache_tree_free: Fix small memory leakElijah Newren, Sep 6, 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.