summaryrefslogtreecommitdiff
path: root/lib
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 22:45:01 +0200
commit9a4ad1b0567ec66876f853f2127ceaa799394bcf (patch)
treedbc852aafe5685808e6d7c52c27e91cfa4b0ccd1 /lib
parentf73de32d469919478fba65b5f4fda6212dc730cd (diff)
downloadcurl-9a4ad1b0567ec66876f853f2127ceaa799394bcf.tar.gz
url: always clone the CUROPT_CURLU handle
Since a few code paths actually update that data. Fixes #3753 Closes #3761 Reported-by: Poul T Lomholt
Diffstat (limited to 'lib')
-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();