* [PATCH] cache_tree_free: Fix small memory leak
@ 2010-09-06 21:40 Elijah Newren
0 siblings, 0 replies; only message in thread
From: Elijah Newren @ 2010-09-06 21:40 UTC (permalink / raw)
To: git; +Cc: gitster, Elijah Newren
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-09-06 21:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 21:40 [PATCH] cache_tree_free: Fix small memory leak Elijah Newren
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).