]> 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)
committerAram Sargsyan <aram@isc.org>
Tue, 28 Feb 2023 14:40:17 +0000 (14:40 +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.

(cherry picked from commit cf79692a662b627d2230fbf7ae67f55cf729180c)

lib/dns/catz.c

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