CURLU: fix NULL dereference when used over proxy

Test 659 verifies

Also fixed the test 658 name

Closes #3641
This commit is contained in:
Daniel Stenberg 2019-03-04 12:03:39 +01:00
parent 2591a491aa
commit 15401fa886
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 140 additions and 4 deletions

View file

@ -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();