From fbd5658db7cddda76e6c6dd3026952b5a17a70ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 13 Mar 2018 11:28:11 +0100 Subject: [PATCH] Fix a zone database reference counting bug in dump_done() 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index a74afcaf53..ea19a8fa2c 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -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;