fix minor memory leak in get_tree_entry()
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Sun, 14 Feb 2010 09:56:46 +0000 (10:56 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 14 Feb 2010 11:04:20 +0000 (03:04 -0800)
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-walk.c

index 02e2aed7737207225f1b96eed774a1b75dd6d8d9..a0fe88c55d2a5063c2367fcff1999d959b6d4909 100644 (file)
@@ -250,6 +250,7 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch
 
        if (name[0] == '\0') {
                hashcpy(sha1, root);
+               free(tree);
                return 0;
        }