diff --git a/CHANGES b/CHANGES index 766916fa5db1e9d945e069bb1008045bc2f61507..f0fe36f185e7f9fdae80415875ed294b14931c46 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,10 @@ Changelog +Daniel (15 December) +- Giuseppe Attardi found and fixed a problem within libcurl that re-used + already freed memory. + Daniel (10 December) - Gisle Vanem reported that the dict support was broken. I broke it during my ftps-changes overhaul. I've now added a 'curlassert' function that can be diff --git a/lib/url.c b/lib/url.c index 0dcc577afe0c981b36c62155cf30a5e0e2dd4866..d21cab247fef1c57f2fd55fd543a5a3f55a43183 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3281,6 +3281,9 @@ CURLcode Curl_do(struct connectdata **connp) conn->bits.close = TRUE; /* enforce close of this connetion */ result = Curl_done(conn); /* we are so done with this */ + + /* conn is no longer a good pointer */ + if(CURLE_OK == result) { bool async; /* Now, redo the connect and get a new connection */ @@ -3288,6 +3291,7 @@ CURLcode Curl_do(struct connectdata **connp) if(CURLE_OK == result) { /* We have connected or sent away a name resolve query fine */ + conn = *connp; /* setup conn to again point to something nice */ if(async) { /* Now, if async is TRUE here, we need to wait for the name to resolve */