]> git.ipfire.org Git - thirdparty/bind9.git/commit
Remove an unnecessary NULL-check
authorAram Sargsyan <aram@isc.org>
Wed, 6 Sep 2023 10:26:36 +0000 (10:26 +0000)
committerAram Sargsyan <aram@isc.org>
Thu, 14 Sep 2023 10:39:24 +0000 (10:39 +0000)
commit2a57c129228ecd4a4a286e9db269b1f8a8d3b8f7
tree58489392e80bdef22b970e7737a22c41a4a31e17
parente25643f01910739157f42e3b99e36b86b97081e7
Remove an unnecessary NULL-check

In the ns__client_put_cb() callback function the 'client->manager'
pointer is guaranteed to be non-NULL, because in ns__client_request(),
before setting up the callback, the ns__client_setup() function is
called for the 'client', which makes sure that 'client->manager' is set.

Removing the NULL-check resolves the following static analyzer warning:

    /lib/ns/client.c: 1675 in ns__client_put_cb()
    1669      dns_message_puttemprdataset(client->message, &client->opt);
    1670      }
    1671      client_extendederror_reset(client);
    1672
    1673      dns_message_detach(&client->message);
    1674
    >>>     CID 465168:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "client->manager" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    1675      if (client->manager != NULL) {
    1676      ns_clientmgr_detach(&client->manager);
    1677      }
    1678
    1679      /*
    1680       * Detaching the task must be done after unlinking from
lib/ns/client.c