1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

multi_runsingle: bail out early on data->conn == NULL

As that's a significant error condition and scan-build warns for NULL
pointer dereferences if we don't.

Closes #6433
This commit is contained in:
Daniel Stenberg 2021-01-11 09:37:44 +01:00
parent 48220f7e3d
commit 06f1db57ca
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1589,9 +1589,12 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
process_pending_handles(multi); /* multiplexed */
}
if(data->conn && data->mstate > CURLM_STATE_CONNECT &&
if(data->mstate > CURLM_STATE_CONNECT &&
data->mstate < CURLM_STATE_COMPLETED) {
/* Make sure we set the connection's current owner */
DEBUGASSERT(data->conn);
if(!data->conn)
return CURLM_INTERNAL_ERROR;
data->conn->data = data;
}