From: W.C.A. Wijngaards Date: Fri, 5 Nov 2021 11:02:50 +0000 (+0100) Subject: - Fix analyzer review failure in rpz action override code to not X-Git-Tag: release-1.14.0rc1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0006c08f15ba6c7c9c09d8337960cfa24904d066;p=thirdparty%2Funbound.git - Fix analyzer review failure in rpz action override code to not crash on unlocking the local zone lock. --- diff --git a/doc/Changelog b/doc/Changelog index 4d4a6a569..eb6fec0b0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,8 @@ 5 November 2021: Wouter - Fix that forward-zone name is documented as the full name of the zone. It is not relative but a fully qualified domain name. + - Fix analyzer review failure in rpz action override code to not + crash on unlocking the local zone lock. 2 November 2021: Wouter - Fix #552: Unbound assumes index.html exists on RPZ host. diff --git a/services/rpz.c b/services/rpz.c index 434660686..6c1fb330f 100644 --- a/services/rpz.c +++ b/services/rpz.c @@ -1476,8 +1476,10 @@ rpz_resolve_client_action_and_zone(struct auth_zones* az, struct query_info* qin r->action_override, qinfo, repinfo, NULL, r->log_name); stats->rpz_action[r->action_override]++; - lock_rw_unlock(&z->lock); - z = NULL; + if(z != NULL) { + lock_rw_unlock(&z->lock); + z = NULL; + } if(node != NULL) { lock_rw_unlock(&node->lock); node = NULL;