From: xquery Date: Mon, 8 Jun 2020 11:25:56 +0000 (+0200) Subject: multi: add defensive check on data->multi->num_alive X-Git-Tag: curl-7_71_0~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a35580e210df6a0548c114665f201ecd759eadd;p=thirdparty%2Fcurl.git multi: add defensive check on data->multi->num_alive Closes #5540 --- diff --git a/lib/multi.c b/lib/multi.c index a614929eca..d20b33dbce 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -168,9 +168,11 @@ static void mstate(struct Curl_easy *data, CURLMstate state } #endif - if(state == CURLM_STATE_COMPLETED) + if(state == CURLM_STATE_COMPLETED) { /* changing to COMPLETED means there's one less easy handle 'alive' */ + DEBUGASSERT(data->multi->num_alive > 0); data->multi->num_alive--; + } /* if this state has an init-function, run it */ if(finit[state])