aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-03-04 12:03:39 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-03-04 16:24:08 +0100
commit15401fa886b707ae2a42b95fa6cf313685306492 (patch)
tree116f48ef772045740d595ed1c9ba7b8fed1d6b77 /lib
parent2591a491aa7cc736dc1751b7b1a4502eac5edf9e (diff)
CURLU: fix NULL dereference when used over proxy
Test 659 verifies Also fixed the test 658 name Closes #3641
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index bc00bfae6..76e912231 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -304,7 +304,8 @@ static void up_free(struct Curl_easy *data)
Curl_safefree(up->options);
Curl_safefree(up->path);
Curl_safefree(up->query);
- curl_url_cleanup(data->state.uh);
+ if(data->set.uh != data->state.uh)
+ curl_url_cleanup(data->state.uh);
data->state.uh = NULL;
}
@@ -2046,7 +2047,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
/* parse the URL */
if(data->set.uh) {
- uh = data->set.uh;
+ uh = data->state.uh = data->set.uh;
}
else {
uh = data->state.uh = curl_url();