cache_tree_free: Fix small memory leak

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren 2010-09-06 15:40:16 -06:00 committed by Junio C Hamano
parent af24059fa2
commit e92fa514a9

View File

@ -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;