diff --git a/lib/multi.c b/lib/multi.c index fb495e078cd5b8dfe5508f827cab7ca6226faacc..e723a3ebf06fbf89ee52b7cf7c825966a8e4a5d1 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -483,6 +483,10 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle, if(!GOOD_EASY_HANDLE(curl_handle)) return CURLM_BAD_EASY_HANDLE; + /* Prevent users from trying to remove same easy handle more than once */ + if(!data->multi) + return CURLM_OK; /* it is already removed so let's say it is fine! */ + if(easy) { bool premature = (data->mstate < CURLM_STATE_COMPLETED) ? TRUE : FALSE; bool easy_owns_conn = (data->easy_conn &&