summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-28 09:41:01 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-28 09:41:01 +0000
commit7c7923761d3eb1dcf3aa54e0aca68a9bef6b76f3 (patch)
tree320edd4ec58f7f83144067b66d8088145b3c89b2
parente9b69bc7575cbe4c58e5ad6d53cd3554a7ef176f (diff)
downloadgnurl-7c7923761d3eb1dcf3aa54e0aca68a9bef6b76f3.tar.gz
gnurl-7c7923761d3eb1dcf3aa54e0aca68a9bef6b76f3.tar.bz2
gnurl-7c7923761d3eb1dcf3aa54e0aca68a9bef6b76f3.zip
free the URL on redirections, this was a previous memory leak
-rw-r--r--lib/highlevel.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/highlevel.c b/lib/highlevel.c
index b3bb9e157..fd061bb7a 100644
--- a/lib/highlevel.c
+++ b/lib/highlevel.c
@@ -718,6 +718,9 @@ CURLcode curl_transfer(CURL *curl)
/* TBD: set the port with curl_setopt() */
data->port = 0;
}
+
+ if(data->bits.urlstringalloc)
+ free(data->url);
/* TBD: set the URL with curl_setopt() */
data->url = data->newurl;
@@ -744,12 +747,6 @@ CURLcode curl_transfer(CURL *curl)
if(data->newurl)
free(data->newurl);
-#if 0
- if((CURLE_OK == res) && data->writeinfo) {
- /* Time to output some info to stdout */
- WriteOut(data);
- }
-#endif
return res;
}