diff options
-rw-r--r-- | http.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -855,11 +855,13 @@ void run_active_slot(struct active_request_slot *slot) static void release_active_slot(struct active_request_slot *slot) { closedown_active_slot(slot); - if (slot->curl && curl_session_count > min_curl_sessions) { + if (slot->curl) { xmulti_remove_handle(slot); - curl_easy_cleanup(slot->curl); - slot->curl = NULL; - curl_session_count--; + if (curl_session_count > min_curl_sessions) { + curl_easy_cleanup(slot->curl); + slot->curl = NULL; + curl_session_count--; + } } #ifdef USE_CURL_MULTI fill_active_slots(); |