]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-ares: remove check for 'data' in Curl_resolver_cancel
authorDaniel Stenberg <daniel@haxx.se>
Sat, 12 Jun 2021 16:37:52 +0000 (18:37 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 13 Jun 2021 21:42:57 +0000 (23:42 +0200)
It implied it would survive a NULL in there which it won't. Instead do
an assert.

Pointed out by scan-build.

Closes #7248

lib/asyn-ares.c

index 9ee307beb027c0c43ac4a8fbaf89e035233efdbf..839fabb86aa323be6351481ecd6ae64c9d44c7d5 100644 (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);
 }