From d3504b92613a50b2bb480dd30bd181a99741f8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Sat, 29 Aug 2015 22:15:34 +0200 Subject: [PATCH] Fix resource leak discovered by Coverity * src/retr.c (retrieve_url): Don't leak local_file. --- src/retr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/retr.c b/src/retr.c index 896b58fe..e2b737e0 100644 --- a/src/retr.c +++ b/src/retr.c @@ -726,7 +726,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file, char *mynewloc, *proxy; struct url *u = orig_parsed, *proxy_url; int up_error_code; /* url parse error code */ - char *local_file; + char *local_file = NULL; int redirection_count = 0; bool method_suspended = false; @@ -754,7 +754,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file, result = NOCONERROR; mynewloc = NULL; - local_file = NULL; + xfree(local_file); proxy_url = NULL; proxy = getproxy (u);