]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix static analysis warnings about localzone locks that are unused.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 4 Aug 2021 08:58:08 +0000 (10:58 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 4 Aug 2021 08:58:08 +0000 (10:58 +0200)
doc/Changelog
services/localzone.c

index 4503feea937aa72155608ce5fc0d3604ef489a86..ccd40966cb1c40b7ef7c63af3be3a7d66600044e 100644 (file)
@@ -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.
index fd2ff2bb67f7d406420f81de7e17f27e5afa7992..54f55ab810e42ee5ca35a50c29199c8c8a6aec88 100644 (file)
@@ -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;
                }