]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
maintain a reference to 'rpz' when calling rpz.c:update_quantum
authorMark Andrews <marka@isc.org>
Wed, 31 Jul 2019 23:30:49 +0000 (09:30 +1000)
committerMark Andrews <marka@isc.org>
Thu, 1 Aug 2019 06:06:59 +0000 (16:06 +1000)
(cherry picked from commit 53800281fea22b2b32cec64e2e9174016581a2a9)

lib/dns/rpz.c

index 9faad9c2f3832f2e3afb6616ace7cfd3e1e92a16..10f5b9ba65d3ab1bce99d61a7d36f9a17ca6b016 100644 (file)
@@ -171,6 +171,9 @@ struct dns_rpz_nm_data {
        dns_rpz_nm_zbits_t      wild;
 };
 
+static void
+rpz_detach(dns_rpz_zone_t **rpzp, dns_rpz_zones_t *rpzs);
+
 #if 0
 /*
  * Catch a name while debugging.
@@ -1991,6 +1994,7 @@ update_quantum(isc_task_t *task, isc_event_t *event) {
                isc_ht_destroy(&rpz->newnodes);
        dns_db_closeversion(rpz->updb, &rpz->updbversion, false);
        dns_db_detach(&rpz->updb);
+       rpz_detach(&rpz, rpz->rpzs);
 }
 
 static void
@@ -2005,6 +2009,7 @@ dns_rpz_update_from_db(dns_rpz_zone_t *rpz) {
        REQUIRE(rpz->updbit == NULL);
        REQUIRE(rpz->newnodes == NULL);
 
+       isc_refcount_increment(&rpz->refs);
        dns_db_attach(rpz->db, &rpz->updb);
        rpz->updbversion = rpz->dbversion;
        rpz->dbversion = NULL;
@@ -2029,6 +2034,7 @@ dns_rpz_update_from_db(dns_rpz_zone_t *rpz) {
                isc_ht_destroy(&rpz->newnodes);
        dns_db_closeversion(rpz->updb, &rpz->updbversion, false);
        dns_db_detach(&rpz->updb);
+       rpz_detach(&rpz, rpz->rpzs);
 }
 
 /*