From bf7a2884fb8e0a020244be99eeda754a6fc5ee26 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 4 Oct 2022 09:08:11 +0200 Subject: [PATCH] - Fix static analysis report to remove dead code from the rpz_callback_from_iterator_module function. --- doc/Changelog | 4 ++++ services/rpz.c | 14 ++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 25357d1a6..b007a168e 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +4 October 2022: Wouter + - Fix static analysis report to remove dead code from the + rpz_callback_from_iterator_module function. + 3 October 2022: George - Merge #760: PROXYv2 downstream support. (New proxy-protocol-port configuration option). diff --git a/services/rpz.c b/services/rpz.c index e8b734a89..e876f3f94 100644 --- a/services/rpz.c +++ b/services/rpz.c @@ -2168,18 +2168,16 @@ rpz_callback_from_iterator_module(struct module_qstate* ms, struct iter_qstate* lock_rw_unlock(&az->rpz_lock); - if(raddr == NULL && z == NULL) { return NULL; } - else if(raddr != NULL) { + if(raddr == NULL && z == NULL) + return NULL; + + if(raddr != NULL) { if(z) { lock_rw_unlock(&z->lock); } return rpz_apply_nsip_trigger(ms, r, raddr, a); - } else if(z != NULL) { - if(raddr) { - lock_rw_unlock(&raddr->lock); - } - return rpz_apply_nsdname_trigger(ms, r, z, &match, a); - } else { return NULL; } + } + return rpz_apply_nsdname_trigger(ms, r, z, &match, a); } struct dns_msg* rpz_callback_from_iterator_cname(struct module_qstate* ms, -- 2.47.3