aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/multi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 39ab97799..c0e4760b8 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -370,6 +370,11 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
to the WAITCONNECT state */
easy->result = Curl_async_resolved(easy->easy_conn);
+ if(CURLE_OK != easy->result)
+ /* if Curl_async_resolved() returns failure, the connection struct
+ is already freed and gone */
+ easy->easy_conn = NULL; /* no more connection */
+
easy->state = CURLM_STATE_WAITCONNECT;
}