diff --git a/lib/multi.c b/lib/multi.c index 94e64478cd..7f5a732bff 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -787,7 +787,7 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) return CURLM_BAD_HANDLE; /* Verify that we got a somewhat good easy handle too */ - if(!GOOD_EASY_HANDLE(data) || !multi->num_easy) + if(!GOOD_EASY_HANDLE(data)) return CURLM_BAD_EASY_HANDLE; /* Prevent users from trying to remove same easy handle more than once */ @@ -798,6 +798,11 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) if(data->multi != multi) return CURLM_BAD_EASY_HANDLE; + if(!multi->num_easy) { + DEBUGASSERT(0); + return CURLM_INTERNAL_ERROR; + } + if(multi->in_callback) return CURLM_RECURSIVE_API_CALL;