From 7ef1a47991fee31c1eb1e1292bf715d577042f35 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 9 Oct 2015 14:55:47 +0200 Subject: ui-repolist: fix resource leak: free before return Coverity-id: 13931 Signed-off-by: Christian Hesse --- ui-repolist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui-repolist.c') 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); -- cgit v1.2.3-70-g09d2