List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/4] ui-repolist: fix resource leak: free before return
@ 2015-10-09 12:55 list
  2015-10-09 12:55 ` [PATCH 2/4] ui-repolist: fix resource leak: free allocation from cgit_currenturl list
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: list @ 2015-10-09 12:55 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Coverity-id: 13931
Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-repolist.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ui-repolist.c b/ui-repolist.c
index ac1b3e3..4f52e0f 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -18,8 +18,10 @@ static time_t read_agefile(char *path)
 	char *buf;
 	struct strbuf date_buf = STRBUF_INIT;
 
-	if (readfile(path, &buf, &size))
+	if (readfile(path, &buf, &size)) {
+		free(buf);
 		return -1;
+	}
 
 	if (parse_date(buf, &date_buf) == 0)
 		result = strtoul(date_buf.buf, NULL, 10);
-- 
2.6.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-09 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-09 12:55 [PATCH 1/4] ui-repolist: fix resource leak: free before return list
2015-10-09 12:55 ` [PATCH 2/4] ui-repolist: fix resource leak: free allocation from cgit_currenturl list
2015-10-09 12:55 ` [PATCH 3/4] ui-plain: fix resource leak: free before return list
2015-10-09 13:50   ` Jason
2015-10-09 12:55 ` [PATCH 4/4] ui-plain: fix resource leak: free before assigning NULL list
2015-10-09 13:49 ` [PATCH 1/4] ui-repolist: fix resource leak: free before return Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).