aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-08-20 16:37:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-08-20 16:37:01 +0200
commit30f2d0c0b321cb17c38a2b21a50016e7901b55b2 (patch)
treef7034072a186390c820dca9a26b4b716394ea30a
parentf854130b7bb6b48ad4dffce8705de5997a2a9a4e (diff)
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
-rw-r--r--lib/url.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/url.c b/lib/url.c
index cf9325308..e43b19d75 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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);