summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-04-11 12:49:20 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-04-11 12:50:34 +0200
commite2caf8069d1bc1e3abc5cbd345c56792c8fb6ad4 (patch)
treeb93d1acfc43f5b26821686bd4f1cd1ff2ce45e16
parent06ace0ba98d8d147f20c93fc34aa9a2457530004 (diff)
downloadcurl-e2caf8069d1bc1e3abc5cbd345c56792c8fb6ad4.tar.gz
url: always clone the CUROPT_CURLU handle
Since a few code paths actually update that data. Fixes #3753 Reported-by: Poul T Lomholt
-rw-r--r--lib/url.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index e5a78a6de..75de68f3c 100644
--- 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();