Skip to content
Snippets Groups Projects
Commit 30f2d0c0 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Curl_disconnect: don't free the URL

The URL is not a property of the connection so it should not be freed in
the connection disconnect but in the Curl_close() that frees the easy
handle.

Bug: http://curl.haxx.se/mail/lib-2014-08/0148.html
Reported-by: Paras S
parent f854130b
No related branches found
No related tags found
No related merge requests found
......@@ -424,6 +424,12 @@ CURLcode Curl_close(struct SessionHandle *data)
Curl_safefree(data->state.scratch);
Curl_ssl_free_certinfo(data);
/* Cleanup possible redirect junk */
if(data->req.newurl) {
free(data->req.newurl);
data->req.newurl = NULL;
}
if(data->change.referer_alloc) {
Curl_safefree(data->change.referer);
data->change.referer_alloc = FALSE;
......@@ -2642,12 +2648,6 @@ CURLcode Curl_disconnect(struct connectdata *conn, bool dead_connection)
/* Cleanup NTLM connection-related data */
Curl_http_ntlm_cleanup(conn);
/* Cleanup possible redirect junk */
if(data->req.newurl) {
free(data->req.newurl);
data->req.newurl = NULL;
}
if(conn->handler->disconnect)
/* This is set if protocol-specific cleanups should be made */
conn->handler->disconnect(conn, dead_connection);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment