]> granicus.if.org Git - curl/commitdiff
Clear the connection pointer after the async resolve has failed.
authorDaniel Stenberg <daniel@haxx.se>
Mon, 13 Oct 2003 12:21:56 +0000 (12:21 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 13 Oct 2003 12:21:56 +0000 (12:21 +0000)
This cures the problem reported by Giuseppe Attardi on October 12, 2003.

lib/multi.c

index 39ab97799dbe4c626b6cdec296b001c88fa01614..c0e4760b84c1315b08f15f5af7ebd55316e0ff9f 100644 (file)
@@ -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;
         }