Code

cache_tree_free: Fix small memory leak
authorElijah Newren <newren@gmail.com>
Mon, 6 Sep 2010 21:40:16 +0000 (15:40 -0600)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Sep 2010 00:32:28 +0000 (17:32 -0700)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c

index c60cf9140dd18254886ea14de763738630f95973..f755590da827234830d8b4359720cfbfd87a3dea 100644 (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;