about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristian Hesse2015-10-09 14:55:47 +0200
committerJason A. Donenfeld2015-10-09 15:49:39 +0200
commit7ef1a47991fee31c1eb1e1292bf715d577042f35 (patch)
tree85428d32a3d3443c2fceaf307eeae822bde5463e
parentfilters: Simplify converters (diff)
downloadcgit-7ef1a47991fee31c1eb1e1292bf715d577042f35.tar.gz
cgit-7ef1a47991fee31c1eb1e1292bf715d577042f35.zip
ui-repolist: fix resource leak: free before return
Coverity-id: 13931
Signed-off-by: Christian Hesse <mail@eworm.de>
-rw-r--r--ui-repolist.c4
1 files changed, 3 insertions, 1 deletions
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)
18 char *buf; 18 char *buf;
19 struct strbuf date_buf = STRBUF_INIT; 19 struct strbuf date_buf = STRBUF_INIT;
20 20
21 if (readfile(path, &buf, &size)) 21 if (readfile(path, &buf, &size)) {
22 free(buf);
22 return -1; 23 return -1;
24 }
23 25
24 if (parse_date(buf, &date_buf) == 0) 26 if (parse_date(buf, &date_buf) == 0)
25 result = strtoul(date_buf.buf, NULL, 10); 27 result = strtoul(date_buf.buf, NULL, 10);