From fef1fc0d32455fe4d04250862bce607900c1439e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 11 May 2001 06:10:48 +0000 Subject: Ingo Wilken's redirect fixes --- lib/transfer.c | 1 + lib/url.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/transfer.c b/lib/transfer.c index 582392148..1dad615f4 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -910,6 +910,7 @@ CURLcode Curl_perform(CURL *curl) /* TBD: set the URL with curl_setopt() */ data->url = newurl; + newurl = NULL; /* don't free! */ data->bits.urlstringalloc = TRUE; /* the URL is allocated */ diff --git a/lib/url.c b/lib/url.c index 8c23ae998..787bc18be 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2233,6 +2233,12 @@ CURLcode Curl_done(struct connectdata *conn) conn->bits.rangestringalloc = FALSE; } + /* Cleanup possible redirect junk */ + if(conn->newurl) { + free(conn->newurl); + conn->newurl = NULL; + } + /* this calls the protocol-specific function pointer previously set */ if(conn->curl_done) result = conn->curl_done(conn); -- cgit v1.2.3