]> git.cameronkatri.com Git - cgit.git/blobdiff - ui-tree.c
ui-tree: fix resource leak: free before return
[cgit.git] / 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;
                }
        }