[PATCH] fetch.c: Plug memory leak in process_tree()
authorSergey Vlasov <vsu@altlinux.ru>
Fri, 23 Sep 2005 12:28:18 +0000 (16:28 +0400)
committerJunio C Hamano <junkio@cox.net>
Fri, 23 Sep 2005 21:30:45 +0000 (14:30 -0700)
When freeing a tree entry, must free its name too.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fetch.c

diff --git a/fetch.c b/fetch.c
index 62f30d1..1a33ae9 100644 (file)
--- a/fetch.c
+++ b/fetch.c
@@ -48,6 +48,7 @@ static int process_tree(struct tree *tree)
                struct tree_entry_list *next = entry->next;
                if (process(entry->item.any))
                        return -1;
+               free(entry->name);
                free(entry);
                entry = next;
        }