From fde1294d05844e395b6875d2ae6d2f8705d0fdfc Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 2 May 2022 12:12:36 +1000 Subject: [PATCH] Remove unnecessary NULL pointer check 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 9024912fde..3bcd47e87b 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -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();