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

content for commit 6092205538

This commit is contained in:
Tim Rühsen 2014-10-09 12:17:07 +02:00
parent 4152e98bb0
commit 148065bc00
6 changed files with 17 additions and 8 deletions

View File

@ -1560,6 +1560,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con, char **local_fi
else else
{ {
/* URL-derived file. Consider "-O file" name. */ /* URL-derived file. Consider "-O file" name. */
xfree (con->target);
con->target = url_file_name (u, NULL); con->target = url_file_name (u, NULL);
if (!opt.output_document) if (!opt.output_document)
locf = con->target; locf = con->target;

View File

@ -1756,7 +1756,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
hs->res = -1; hs->res = -1;
hs->rderrmsg = NULL; hs->rderrmsg = NULL;
hs->newloc = NULL; hs->newloc = NULL;
hs->remote_time = NULL; xfree(hs->remote_time); hs->remote_time = NULL;
hs->error = NULL; hs->error = NULL;
hs->message = NULL; hs->message = NULL;
@ -1868,6 +1868,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
{ {
logprintf (LOG_NOTQUIET, _("BODY data file %s missing: %s\n"), logprintf (LOG_NOTQUIET, _("BODY data file %s missing: %s\n"),
quote (opt.body_file), strerror (errno)); quote (opt.body_file), strerror (errno));
request_free (req);
return FILEBADFILE; return FILEBADFILE;
} }
} }

View File

@ -69,6 +69,7 @@ as that of the covered work. */
#include "retr.h" /* for output_stream */ #include "retr.h" /* for output_stream */
#include "warc.h" /* for warc_close */ #include "warc.h" /* for warc_close */
#include "spider.h" /* for spider_cleanup */ #include "spider.h" /* for spider_cleanup */
#include "html-url.h" /* for cleanup_html_url */
#ifdef TESTING #ifdef TESTING
#include "test.h" #include "test.h"
@ -1747,10 +1748,7 @@ cleanup (void)
spider_cleanup (); spider_cleanup ();
host_cleanup (); host_cleanup ();
log_cleanup (); log_cleanup ();
netrc_cleanup (netrc_list); netrc_cleanup ();
for (i = 0; i < nurl; i++)
xfree (url[i]);
xfree_null (opt.choose_config); xfree_null (opt.choose_config);
xfree_null (opt.lfilename); xfree_null (opt.lfilename);
@ -1759,8 +1757,8 @@ cleanup (void)
xfree_null (opt.output_document); xfree_null (opt.output_document);
free_vec (opt.accepts); free_vec (opt.accepts);
free_vec (opt.rejects); free_vec (opt.rejects);
free_vec (opt.excludes); free_vec ((char **)opt.excludes);
free_vec (opt.includes); free_vec ((char **)opt.includes);
free_vec (opt.domains); free_vec (opt.domains);
free_vec (opt.follow_tags); free_vec (opt.follow_tags);
free_vec (opt.ignore_tags); free_vec (opt.ignore_tags);
@ -1792,6 +1790,10 @@ cleanup (void)
xfree_null (opt.passwd); xfree_null (opt.passwd);
xfree_null (opt.base_href); xfree_null (opt.base_href);
xfree_null (opt.method); xfree_null (opt.method);
xfree_null (opt.post_file_name);
xfree_null (opt.post_data);
xfree_null (opt.body_data);
xfree_null (opt.body_file);
#endif /* DEBUG_MALLOC */ #endif /* DEBUG_MALLOC */
} }

View File

@ -1455,11 +1455,13 @@ for details.\n\n"));
if (opt.post_data) if (opt.post_data)
{ {
setoptval ("bodydata", opt.post_data, "body-data"); setoptval ("bodydata", opt.post_data, "body-data");
xfree(opt.post_data);
opt.post_data = NULL; opt.post_data = NULL;
} }
else else
{ {
setoptval ("bodyfile", opt.post_file_name, "body-file"); setoptval ("bodyfile", opt.post_file_name, "body-file");
xfree(opt.post_file_name);
opt.post_file_name = NULL; opt.post_file_name = NULL;
} }
} }

View File

@ -761,7 +761,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
pi->utf8_encode = false; pi->utf8_encode = false;
/* Parse the proxy URL. */ /* Parse the proxy URL. */
proxy_url = url_parse (proxy, &up_error_code, NULL, true); proxy_url = url_parse (proxy, &up_error_code, pi, true);
if (!proxy_url) if (!proxy_url)
{ {
char *error = url_error (proxy, up_error_code); char *error = url_error (proxy, up_error_code);
@ -782,6 +782,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
result = PROXERR; result = PROXERR;
goto bail; goto bail;
} }
iri_free(pi);
free (proxy); free (proxy);
} }
@ -930,6 +931,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
if (u) if (u)
{ {
DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url))); DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url)));
xfree (url);
url = xstrdup (u->url); url = xstrdup (u->url);
iri_fallbacked = 1; iri_fallbacked = 1;
goto redirected; goto redirected;

View File

@ -705,6 +705,7 @@ url_parse (const char *url, int *error, struct iri *iri, bool percent_encode)
new_url = NULL; new_url = NULL;
else else
{ {
xfree_null (iri->orig_url);
iri->orig_url = xstrdup (url); iri->orig_url = xstrdup (url);
url_encoded = reencode_escapes (new_url); url_encoded = reencode_escapes (new_url);
if (url_encoded != new_url) if (url_encoded != new_url)