]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a zone database reference counting bug in dump_done()
authorMichał Kępień <michal@isc.org>
Tue, 13 Mar 2018 10:28:11 +0000 (11:28 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 13 Mar 2018 10:28:11 +0000 (11:28 +0100)
A typo in commit d39ab7440e introduced a bug in zone database reference
counting which leads to a crash if dumping one version of a slave zone
is not finished by the time transferring a newer version from a master
completes.  Correct the typo to fix reference counting, thus preventing
crashes.

lib/dns/zone.c

index a74afcaf5322ef366359c0e640484c9d3fe637ef..ea19a8fa2cb933c2890f730f9bfcbd91ecf5e872 100644 (file)
@@ -10345,7 +10345,7 @@ dump_done(void *arg, isc_result_t result) {
                        dns_db_t *zdb = NULL;
                        if (dns_zone_getdb(zone, &zdb) == ISC_R_SUCCESS) {
                                zone_journal_compact(zone, zdb, serial);
-                               dns_db_detach(&db);
+                               dns_db_detach(&zdb);
                        }
                } else if (tresult == ISC_R_SUCCESS) {
                        compact = ISC_TRUE;