curl_easy_reset: reset the URL
authorDaniel Stenberg <daniel@haxx.se>
Sat, 24 May 2014 17:05:12 +0000 (19:05 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 24 May 2014 17:06:11 +0000 (19:06 +0200)
Make sure that the URL is reset and cleared.

Bug: http://curl.haxx.se/mail/lib-2014-05/0235.html
Reported-by: Jonathan Cardoso Machado
lib/url.c

index 7d2592b..2922292 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -278,6 +278,11 @@ void Curl_freeset(struct SessionHandle *data)
     data->change.referer_alloc = FALSE;
   }
   data->change.referer = NULL;
+  if(data->change.url_alloc) {
+    Curl_safefree(data->change.url);
+    data->change.url_alloc = FALSE;
+  }
+  data->change.url = NULL;
 }
 
 static CURLcode setstropt(char **charp, char *s)