1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Fixed minor memory leaks.

This commit is contained in:
hniksic 2000-11-01 16:18:27 -08:00
parent b3758323ed
commit 986c445029
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2000-11-02 Hrvoje Niksic <hniksic@arsdigita.com>
* retr.c (retrieve_url): Free url before returning.
(retrieve_url): Free mynewloc before returning.
Spotted by Mark A. Mankins <Mankins_Mark@prc.com>.
2000-11-02 Hrvoje Niksic <hniksic@arsdigita.com> 2000-11-02 Hrvoje Niksic <hniksic@arsdigita.com>
* url.c (parseurl): Remove possible reading past the end of * url.c (parseurl): Remove possible reading past the end of

View File

@ -344,6 +344,7 @@ retrieve_url (const char *origurl, char **file, char **newloc,
logprintf (LOG_NOTQUIET, "%s: %s.\n", url, uerrmsg (result)); logprintf (LOG_NOTQUIET, "%s: %s.\n", url, uerrmsg (result));
freeurl (u, 1); freeurl (u, 1);
free_slist (redirections); free_slist (redirections);
free (url);
return result; return result;
} }
@ -379,6 +380,7 @@ retrieve_url (const char *origurl, char **file, char **newloc,
logputs (LOG_NOTQUIET, _("Could not find proxy host.\n")); logputs (LOG_NOTQUIET, _("Could not find proxy host.\n"));
freeurl (u, 1); freeurl (u, 1);
free_slist (redirections); free_slist (redirections);
free (url);
return PROXERR; return PROXERR;
} }
/* Parse the proxy URL. */ /* 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); logprintf (LOG_NOTQUIET, _("Proxy %s: Must be HTTP.\n"), proxy);
freeurl (u, 1); freeurl (u, 1);
free_slist (redirections); free_slist (redirections);
free (url);
return PROXERR; return PROXERR;
} }
u->proto = URLHTTP; u->proto = URLHTTP;
@ -452,6 +455,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
freeurl (newloc_struct, 1); freeurl (newloc_struct, 1);
freeurl (u, 1); freeurl (u, 1);
free_slist (redirections); free_slist (redirections);
free (url);
free (mynewloc);
return result; return result;
} }
@ -469,6 +474,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
freeurl (newloc_struct, 1); freeurl (newloc_struct, 1);
freeurl (u, 1); freeurl (u, 1);
free_slist (redirections); free_slist (redirections);
free (url);
free (mynewloc);
return WRONGCODE; return WRONGCODE;
} }
@ -481,6 +488,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
freeurl (newloc_struct, 1); freeurl (newloc_struct, 1);
freeurl (u, 1); freeurl (u, 1);
free_slist (redirections); free_slist (redirections);
free (url);
free (mynewloc);
return WRONGCODE; return WRONGCODE;
} }
@ -600,7 +609,7 @@ downloaded_exceeds_quota (void)
if (!opt.quota) if (!opt.quota)
return 0; return 0;
if (opt.downloaded_overflow) if (opt.downloaded_overflow)
/* We don't really no. (Wildly) assume not. */ /* We don't really know. (Wildly) assume not. */
return 0; return 0;
return opt.downloaded > opt.quota; return opt.downloaded > opt.quota;