]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove unneded NULL-checking
authorAram Sargsyan <aram@isc.org>
Mon, 6 Jun 2022 15:12:46 +0000 (15:12 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Tue, 7 Jun 2022 09:51:47 +0000 (09:51 +0000)
Fix an issue reported by Coverity by removing the unneded check.

    *** CID 352554:  Null pointer dereferences  (REVERSE_INULL)
    /bin/dig/dighost.c: 3056 in start_tcp()
    3050
    3051      if (ISC_LINK_LINKED(query, link)) {
    3052      next = ISC_LIST_NEXT(query, link);
    3053      } else {
    3054      next = NULL;
    3055      }
    >>>    CID 352554:  Null pointer dereferences  (REVERSE_INULL)
    >>>    Null-checking "connectquery" suggests that it may be null, but it
           has already been dereferenced on all paths leading to the check.
    3056      if (connectquery != NULL) {
    3057      query_detach(&connectquery);
    3058      }
    3059      query_detach(&query);
    3060      if (next == NULL) {
    3061      clear_current_lookup();

bin/dig/dighost.c

index 4a2e88fecf42463aabc631deb7da8a19a6c22064..40d004c1ef5f833ea446edb1837a06712a05cebf 100644 (file)
@@ -3053,9 +3053,7 @@ failure_tls:
        } else {
                next = NULL;
        }
-       if (connectquery != NULL) {
-               query_detach(&connectquery);
-       }
+       query_detach(&connectquery);
        query_detach(&query);
        if (next == NULL) {
                clear_current_lookup();