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
{
/* URL-derived file. Consider "-O file" name. */
xfree (con->target);
con->target = url_file_name (u, NULL);
if (!opt.output_document)
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->rderrmsg = NULL;
hs->newloc = NULL;
hs->remote_time = NULL;
xfree(hs->remote_time); hs->remote_time = NULL;
hs->error = 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"),
quote (opt.body_file), strerror (errno));
request_free (req);
return FILEBADFILE;
}
}

View File

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

View File

@ -1455,11 +1455,13 @@ for details.\n\n"));
if (opt.post_data)
{
setoptval ("bodydata", opt.post_data, "body-data");
xfree(opt.post_data);
opt.post_data = NULL;
}
else
{
setoptval ("bodyfile", opt.post_file_name, "body-file");
xfree(opt.post_file_name);
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;
/* 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)
{
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;
goto bail;
}
iri_free(pi);
free (proxy);
}
@ -930,6 +931,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
if (u)
{
DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url)));
xfree (url);
url = xstrdup (u->url);
iri_fallbacked = 1;
goto redirected;

View File

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