From: W.C.A. Wijngaards Date: Tue, 4 Oct 2022 07:08:11 +0000 (+0200) Subject: - Fix static analysis report to remove dead code from the X-Git-Tag: release-1.17.0rc1~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf7a2884fb8e0a020244be99eeda754a6fc5ee26;p=thirdparty%2Funbound.git - Fix static analysis report to remove dead code from the rpz_callback_from_iterator_module function. --- 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,