aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorPasha Kuznetsov <b4uuzv3dgk@snkmail.com>2010-12-18 22:35:37 +0100
committerDaniel Stenberg <daniel@haxx.se>2010-12-18 22:35:37 +0100
commit6b5dc725756984da68da5c3866c6bb8ef10527cb (patch)
tree890d27220bab321dcb8d7f0c49487fbe19189595 /lib/url.c
parent8ab137b2bc9630ce20f45fd09b4ed2149afa45fd (diff)
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
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index 8511ffe4c..95d024d52 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5347,12 +5347,13 @@ CURLcode Curl_do(struct connectdata **connp, bool *done)
if(result == CURLE_OK) {
/* ... 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);
}
}
- else {
+ else
return result;
- }
}
if((result == CURLE_OK) && *done)