Skip to content

Commit

Permalink
url: always clone the CUROPT_CURLU handle
Browse files Browse the repository at this point in the history
Since a few code paths actually update that data.

Fixes #3753

Reported-by: Poul T Lomholt
  • Loading branch information
bagder committed Apr 11, 2019
1 parent 06ace0b commit e2caf80
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/url.c
Expand Up @@ -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;
}

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

0 comments on commit e2caf80

Please sign in to comment.