]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove unnecessary NULL pointer check
authorMark Andrews <marka@isc.org>
Mon, 2 May 2022 02:12:36 +0000 (12:12 +1000)
committerMark Andrews <marka@isc.org>
Mon, 2 May 2022 13:58:41 +0000 (23:58 +1000)
    3034                next = ISC_LIST_NEXT(query, link);
    3035        } else {
    3036                next = NULL;
    3037        }

    CID 352554 (#1 of 1): Dereference before null check (REVERSE_INULL)
    check_after_deref: Null-checking connectquery suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    3038        if (connectquery != NULL) {
    3039                query_detach(&connectquery);
    3040        }

(cherry picked from commit 30f3d513682917cd0bb60a56efa25d39f121221f)

bin/dig/dighost.c

index 9024912fde1358eab4731edf2cf50d9270740246..3bcd47e87b49d5e5bc7e8ae22e5e8ff438d08821 100644 (file)
@@ -3034,9 +3034,7 @@ failure_tls:
        } else {
                next = NULL;
        }
-       if (connectquery != NULL) {
-               query_detach(&connectquery);
-       }
+       query_detach(&connectquery);
        query_detach(&query);
        if (next == NULL) {
                clear_current_lookup();