From: W.C.A. Wijngaards Date: Thu, 6 Feb 2020 10:51:17 +0000 (+0100) Subject: - Fix to create and destroy rpz_lock in auth_zones structure. X-Git-Tag: release-1.10.0rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d000523b000c1899cb23673297d1aba550df08c8;p=thirdparty%2Funbound.git - Fix to create and destroy rpz_lock in auth_zones structure. --- diff --git a/doc/Changelog b/doc/Changelog index 9fe7f3cc5..4f272ecc1 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ 6 February 2020: Wouter - Fix num_reply_addr counting in mesh and tcp drop due to size after serve_stale commit. + - Fix to create and destroy rpz_lock in auth_zones structure. 5 February 2020: George - Added serve-stale functionality as described in diff --git a/services/authzone.c b/services/authzone.c index edff3e6dd..34170abaf 100644 --- a/services/authzone.c +++ b/services/authzone.c @@ -299,6 +299,8 @@ struct auth_zones* auth_zones_create(void) lock_protect(&az->lock, &az->ztree, sizeof(az->ztree)); lock_protect(&az->lock, &az->xtree, sizeof(az->xtree)); /* also lock protects the rbnode's in struct auth_zone, auth_xfer */ + lock_rw_init(&az->rpz_lock); + lock_protect(&az->rpz_lock, &az->rpz_first, sizeof(az->rpz_first)); return az; } @@ -2104,6 +2106,7 @@ void auth_zones_delete(struct auth_zones* az) { if(!az) return; lock_rw_destroy(&az->lock); + lock_rw_destroy(&az->rpz_lock); traverse_postorder(&az->ztree, auth_zone_del, NULL); traverse_postorder(&az->xtree, auth_xfer_del, NULL); free(az);