From 0a35580e210df6a0548c114665f201ecd759eadd Mon Sep 17 00:00:00 2001 From: xquery Date: Mon, 8 Jun 2020 13:25:56 +0200 Subject: multi: add defensive check on data->multi->num_alive Closes #5540 --- lib/multi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/multi.c b/lib/multi.c index a614929ec..d20b33dbc 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]) -- cgit v1.2.3