Skip to content

Commit

Permalink
cache_tree_free: Fix small memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
newren authored and gitster committed Sep 7, 2010
1 parent af24059 commit e92fa51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cache-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e92fa51

Please sign in to comment.