]> granicus.if.org Git - cgit/commitdiff
ui-tree: fix resource leak: free before return
authorChristian Hesse <mail@eworm.de>
Fri, 9 Oct 2015 11:15:44 +0000 (13:15 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 9 Oct 2015 11:58:25 +0000 (13:58 +0200)
Coverity-id: 13938
Signed-off-by: Christian Hesse <mail@eworm.de>
ui-tree.c

index 1b310d5304b2ebd8c44594e018bc3eb534a6e8f0..d71503da1f7691329946e481434f1998eb811454 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -143,6 +143,7 @@ static int ls_item(const unsigned char *sha1, struct strbuf *base,
                        htmlf("<tr><td colspan='3'>Bad object: %s %s</td></tr>",
                              name,
                              sha1_to_hex(sha1));
+                       free(name);
                        return 0;
                }
        }