diff options
author | Christian Hesse | 2015-10-09 14:55:47 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2015-10-09 15:49:39 +0200 |
commit | 7ef1a47991fee31c1eb1e1292bf715d577042f35 (patch) | |
tree | 85428d32a3d3443c2fceaf307eeae822bde5463e | |
parent | 525c815cc400bc49881144bcd7e7b717bbc1af5d (diff) | |
download | cgit-7ef1a47991fee31c1eb1e1292bf715d577042f35.tar.gz cgit-7ef1a47991fee31c1eb1e1292bf715d577042f35.tar.bz2 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.c | 4 |
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); |