]> granicus.if.org Git - curl/commitdiff
if the DO operation returns failure, bail out and close down nicely to
authorDaniel Stenberg <daniel@haxx.se>
Sun, 30 Jan 2005 22:54:06 +0000 (22:54 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 30 Jan 2005 22:54:06 +0000 (22:54 +0000)
prevent memory leakage

lib/multi.c

index e4773d06d14169a5b9471bf699850ea716fde9a7..159e51e53ca66c7084b08fa6693f35381e9b39e2 100644 (file)
@@ -462,6 +462,13 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
             }
           }
         }
+        else {
+          /* failure detected */
+          Curl_posttransfer(easy->easy_handle);
+          Curl_done(&easy->easy_conn, easy->result);
+          Curl_disconnect(easy->easy_conn); /* close the connection */
+          easy->easy_conn = NULL;           /* no more connection */
+        }
         break;
 
       case CURLM_STATE_DO_MORE: