Skip to content
Snippets Groups Projects
Commit 6b5dc725 authored by Pasha Kuznetsov's avatar Pasha Kuznetsov Committed by Daniel Stenberg
Browse files

Curl_do: avoid using stale conn pointer

Since the original `conn' pointer was used after the `connectdata' it
points to has been closed/cleaned up by Curl_reconnect_request it caused
a crash. We must make sure to use the newly created connection instead!

URL: http://curl.haxx.se/mail/lib-2010-12/0202.html
parent 8ab137b2
No related branches found
No related tags found
No related merge requests found
...@@ -5347,12 +5347,13 @@ CURLcode Curl_do(struct connectdata **connp, bool *done) ...@@ -5347,12 +5347,13 @@ CURLcode Curl_do(struct connectdata **connp, bool *done)
if(result == CURLE_OK) { if(result == CURLE_OK) {
/* ... finally back to actually retry the DO phase */ /* ... finally back to actually retry the DO phase */
conn = *connp; /* re-assign conn since Curl_reconnect_request
creates a new connection */
result = conn->handler->do_it(conn, done); result = conn->handler->do_it(conn, done);
} }
} }
else { else
return result; return result;
}
} }
if((result == CURLE_OK) && *done) if((result == CURLE_OK) && *done)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment