From: W.C.A. Wijngaards Date: Wed, 4 Aug 2021 08:58:08 +0000 (+0200) Subject: - Fix static analysis warnings about localzone locks that are unused. X-Git-Tag: release-1.13.2rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9bb0604db222739ce9aec18685f26b4f06f4452;p=thirdparty%2Funbound.git - Fix static analysis warnings about localzone locks that are unused. --- diff --git a/doc/Changelog b/doc/Changelog index 4503feea9..ccd40966c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -7,6 +7,7 @@ 4 August 2021: Wouter - In unit test use openssl set security level to allow keys in test. + - Fix static analysis warnings about localzone locks that are unused. 3 August 2021: George - Listen to read or write events after the SSL handshake. diff --git a/services/localzone.c b/services/localzone.c index fd2ff2bb6..54f55ab81 100644 --- a/services/localzone.c +++ b/services/localzone.c @@ -745,9 +745,15 @@ static int lz_enter_zones(struct local_zones* zones, struct config_file* cfg) { struct config_str2list* p; +#ifndef THREADS_DISABLED struct local_zone* z; +#endif for(p = cfg->local_zones; p; p = p->next) { - if(!(z=lz_enter_zone(zones, p->str, p->str2, + if(!( +#ifndef THREADS_DISABLED + z= +#endif + lz_enter_zone(zones, p->str, p->str2, LDNS_RR_CLASS_IN))) return 0; lock_rw_unlock(&z->lock); @@ -1027,7 +1033,9 @@ lz_setup_implicit(struct local_zones* zones, struct config_file* cfg) } if(have_name) { uint8_t* n2; +#ifndef THREADS_DISABLED struct local_zone* z; +#endif /* allocate zone of smallest shared topdomain to contain em */ n2 = nm; dname_remove_labels(&n2, &nmlen, nmlabs - match); @@ -1039,7 +1047,11 @@ lz_setup_implicit(struct local_zones* zones, struct config_file* cfg) } log_nametypeclass(VERB_ALGO, "implicit transparent local-zone", n2, 0, dclass); - if(!(z=lz_enter_zone_dname(zones, n2, nmlen, match, + if(!( +#ifndef THREADS_DISABLED + z= +#endif + lz_enter_zone_dname(zones, n2, nmlen, match, local_zone_transparent, dclass))) { return 0; }