]> granicus.if.org Git - curl/commitdiff
url: always clone the CUROPT_CURLU handle
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Apr 2019 10:49:20 +0000 (12:49 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 11 Apr 2019 20:45:01 +0000 (22:45 +0200)
Since a few code paths actually update that data.

Fixes #3753
Closes #3761

Reported-by: Poul T Lomholt
lib/url.c

index e5a78a6dee8ca5bfad052fed05db849c3bb7e4cd..75de68f3c64cf909748748c8fd5de4268ec7c884 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -303,8 +303,7 @@ static void up_free(struct Curl_easy *data)
   Curl_safefree(up->options);
   Curl_safefree(up->path);
   Curl_safefree(up->query);
-  if(data->set.uh != data->state.uh)
-    curl_url_cleanup(data->state.uh);
+  curl_url_cleanup(data->state.uh);
   data->state.uh = NULL;
 }
 
@@ -1879,7 +1878,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
 
   /* parse the URL */
   if(data->set.uh) {
-    uh = data->state.uh = data->set.uh;
+    uh = data->state.uh = curl_url_dup(data->set.uh);
   }
   else {
     uh = data->state.uh = curl_url();