retr.c: Fix two memory leaks when proxy URL is bad

Reported by: Coverity bug 1188047
This commit is contained in:
Darshit Shah 2015-03-01 12:45:01 +05:30
parent 524f26a200
commit 735cc220e3
1 changed files with 4 additions and 0 deletions

View File

@ -772,6 +772,8 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
proxy, error);
xfree (url);
xfree (error);
xfree (proxy);
iri_free (pi);
RESTORE_METHOD;
result = PROXERR;
goto bail;
@ -781,6 +783,8 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
logprintf (LOG_NOTQUIET, _("Error in proxy URL %s: Must be HTTP.\n"), proxy);
url_free (proxy_url);
xfree (url);
xfree (proxy);
iri_free (pi);
RESTORE_METHOD;
result = PROXERR;
goto bail;