1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-24 17:18:48 -05:00

asyn-ares: remove check for 'data' in Curl_resolver_cancel

It implied it would survive a NULL in there which it won't. Instead do
an assert.

Pointed out by scan-build.

Closes #7248
This commit is contained in:
Daniel Stenberg 2021-06-12 18:37:52 +02:00
parent 73f52ad763
commit c4b8ec495d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -206,7 +206,8 @@ static void destroy_async_data(struct Curl_async *async);
*/
void Curl_resolver_cancel(struct Curl_easy *data)
{
if(data && data->state.async.resolver)
DEBUGASSERT(data);
if(data->state.async.resolver)
ares_cancel((ares_channel)data->state.async.resolver);
destroy_async_data(&data->state.async);
}