]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
catz: unregister the db update-notify callback before detaching from db
authorAram Sargsyan <aram@isc.org>
Fri, 27 Jan 2023 08:47:52 +0000 (08:47 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 27 Feb 2023 10:06:32 +0000 (10:06 +0000)
When detaching from the previous version of the database, make sure
that the update-notify callback is unregistered, otherwise there is
an INSIST check which can generate an assertion failure in free_rbtdb(),
which checks that there are no outstanding update listeners in the list.

There is a similar code already in place for RPZ.

lib/dns/catz.c

index 97241d1352c14c5db58fc825f821fd2b3b4e5f3e..2faef31132270fbe9fa99b9dbd8c3b6bc9752109 100644 (file)
@@ -2106,6 +2106,8 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
                if (catz->dbversion != NULL) {
                        dns_db_closeversion(catz->db, &catz->dbversion, false);
                }
+               dns_db_updatenotify_unregister(
+                       catz->db, dns_catz_dbupdate_callback, catz->catzs);
                dns_db_detach(&catz->db);
                /*
                 * We're not registering db update callback, it will be