diff --git a/src/ChangeLog b/src/ChangeLog index f4f7336f..833671f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2000-11-02 Hrvoje Niksic + + * retr.c (retrieve_url): Free url before returning. + (retrieve_url): Free mynewloc before returning. + Spotted by Mark A. Mankins . + 2000-11-02 Hrvoje Niksic * url.c (parseurl): Remove possible reading past the end of diff --git a/src/retr.c b/src/retr.c index 5f9327a3..3d5a3210 100644 --- a/src/retr.c +++ b/src/retr.c @@ -344,6 +344,7 @@ retrieve_url (const char *origurl, char **file, char **newloc, logprintf (LOG_NOTQUIET, "%s: %s.\n", url, uerrmsg (result)); freeurl (u, 1); free_slist (redirections); + free (url); return result; } @@ -379,6 +380,7 @@ retrieve_url (const char *origurl, char **file, char **newloc, logputs (LOG_NOTQUIET, _("Could not find proxy host.\n")); freeurl (u, 1); free_slist (redirections); + free (url); return PROXERR; } /* Parse the proxy URL. */ @@ -391,6 +393,7 @@ retrieve_url (const char *origurl, char **file, char **newloc, logprintf (LOG_NOTQUIET, _("Proxy %s: Must be HTTP.\n"), proxy); freeurl (u, 1); free_slist (redirections); + free (url); return PROXERR; } u->proto = URLHTTP; @@ -452,6 +455,8 @@ retrieve_url (const char *origurl, char **file, char **newloc, freeurl (newloc_struct, 1); freeurl (u, 1); free_slist (redirections); + free (url); + free (mynewloc); return result; } @@ -469,6 +474,8 @@ retrieve_url (const char *origurl, char **file, char **newloc, freeurl (newloc_struct, 1); freeurl (u, 1); free_slist (redirections); + free (url); + free (mynewloc); return WRONGCODE; } @@ -481,6 +488,8 @@ retrieve_url (const char *origurl, char **file, char **newloc, freeurl (newloc_struct, 1); freeurl (u, 1); free_slist (redirections); + free (url); + free (mynewloc); return WRONGCODE; } @@ -600,7 +609,7 @@ downloaded_exceeds_quota (void) if (!opt.quota) return 0; if (opt.downloaded_overflow) - /* We don't really no. (Wildly) assume not. */ + /* We don't really know. (Wildly) assume not. */ return 0; return opt.downloaded > opt.quota;