ui-repolist: fix resource leak: free before return
Coverity-id: 13931 Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
parent
525c815cc4
commit
7ef1a47991
@ -18,8 +18,10 @@ static time_t read_agefile(char *path)
|
|||||||
char *buf;
|
char *buf;
|
||||||
struct strbuf date_buf = STRBUF_INIT;
|
struct strbuf date_buf = STRBUF_INIT;
|
||||||
|
|
||||||
if (readfile(path, &buf, &size))
|
if (readfile(path, &buf, &size)) {
|
||||||
|
free(buf);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (parse_date(buf, &date_buf) == 0)
|
if (parse_date(buf, &date_buf) == 0)
|
||||||
result = strtoul(date_buf.buf, NULL, 10);
|
result = strtoul(date_buf.buf, NULL, 10);
|
||||||
|
Loading…
Reference in New Issue
Block a user