]> sjero.net Git - wget/blobdiff - src/retr.c
Don't forget to free the iri struct
[wget] / src / retr.c
index 691b8f51a907c9f320352e0d8c295f91a40b4393..4731d9ee83335366a7dc15b554e47b1d96247bc9 100644 (file)
@@ -51,7 +51,6 @@ as that of the covered work.  */
 #include "hash.h"
 #include "convert.h"
 #include "ptimer.h"
-#include "iri.h"
 #include "html-url.h"
 
 /* Total size of downloaded files.  Used to enforce quota.  */
@@ -636,7 +635,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
     }
 
   DEBUGP (("[IRI Retrieving %s with %s (UTF-8=%d)\n", quote (url),
-             quote (iri->uri_encoding), iri->utf8_encode));
+           iri->uri_encoding ? quote (iri->uri_encoding) : "None",
+           iri->utf8_encode));
 
   if (!refurl)
     refurl = opt.referer;
@@ -653,7 +653,7 @@ retrieve_url (const char *origurl, char **file, char **newloc,
     {
       /* sXXXav : could a proxy include a path ??? */
       struct iri *pi = iri_new ();
-      set_uri_encoding (pi, opt.locale);
+      set_uri_encoding (pi, opt.locale, true);
       pi->utf8_encode = false;
 
       /* Parse the proxy URL.  */
@@ -928,6 +928,8 @@ Removing file due to --delete-after in retrieve_from_file():\n"));
   /* Free the linked list of URL-s.  */
   free_urlpos (url_list);
 
+  iri_free (iri);
+
   return status;
 }
 
@@ -1083,7 +1085,7 @@ url_uses_proxy (const char *url)
   struct url *u;
   struct iri *i = iri_new();
   /* url was given in the command line, so use locale as encoding */
-  set_uri_encoding (i, opt.locale);
+  set_uri_encoding (i, opt.locale, true);
   u= url_parse (url, NULL, i);
   if (!u)
     return false;