From a0ee78f582540fd8ab7dce2a57a0c7e6e4b08937 Mon Sep 17 00:00:00 2001 From: Ed Sabol Date: Sun, 12 Nov 2023 18:29:49 -0500 Subject: [PATCH] Fixed redundant null check due to previous dereference found in CodeQL scan. --- libtest/server.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libtest/server.cc b/libtest/server.cc index e18ff7407..f644465bf 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -172,15 +172,9 @@ bool Server::wait_for_pidfile() const bool Server::init(const char *argv[]) { - if (argv) + for (const char **ptr= argv; ptr && *ptr ; ++ptr) { - for (const char **ptr= argv; *ptr ; ++ptr) - { - if (ptr) - { - add_option(*ptr); - } - } + add_option(*ptr); } return build();