Tim Rühsen wrote:
Thanks, Gisle.
pushed with several additional fixes/cleanups regarding idn2.
Too much cleanups I guess since it's crashing because no
'idn2_free()' called when needed. This works here:
--- a/url.c 2017-04-08 11:24:21
+++ b/url.c 2017-04-08 11:38:37
@@ -944,6 +944,7 @@
{
xfree (u->host);
u->host = new;
+ u->idn_allocated = true;
host_modified = true;
}
}
@@ -1222,6 +1223,9 @@
{
if (url)
{
+ if (url->idn_allocated)
+ idn2_free (url->host);
+ else
xfree (url->host);
xfree (url->path);
--- a/url.h 2017-04-08 11:24:21
+++ b/url.h 2017-04-08 11:35:26
@@ -84,6 +84,7 @@
enum url_scheme scheme; /* URL scheme */
char *host; /* Extracted hostname */
+ bool idn_allocated; /* 'host' allocated by libidn2 */
int port; /* Port number */
-----------
--
--gv