[PATCH 1/8] ui-tree: fix resource leak: free before return

Christian Hesse list at eworm.de
Fri Oct 9 13:15:44 CEST 2015


From: Christian Hesse <mail at eworm.de>

Coverity-id: 13938
Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-tree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui-tree.c b/ui-tree.c
index 1b310d5..d71503d 100644
--- 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;
 		}
 	}
-- 
2.6.1



More information about the CGit mailing list