From 5ddac5ae9fc4ecaf89fbc614437f2bf85a807a58 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 1 Apr 2005 07:05:06 +0000 Subject: [PATCH] 1847. [bug] isc_ondestroy_init() is called too late in in dns_rbtdb_create()/dns_rbtdb_create(). [RT #13661] --- CHANGES | 4 ++++ lib/dns/rbtdb.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5456bff448..d3c4f414c7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1847. [bug] isc_ondestroy_init() is called too late in + in dns_rbtdb_create()/dns_rbtdb_create(). + [RT #13661] + 1846. [contrib] query-loc-0.3.0 from Stephane Bortzmeyer . diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 4f87779ab7..4cacefcb2d 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.168.2.20 2005/03/16 00:57:42 marka Exp $ */ +/* $Id: rbtdb.c,v 1.168.2.21 2005/04/01 07:05:06 marka Exp $ */ /* * Principal Author: Bob Halley @@ -4631,6 +4631,11 @@ dns_rbtdb_create */ isc_mem_attach(mctx, &rbtdb->common.mctx); + /* + * Must be initalized before free_rbtdb() is called. + */ + isc_ondestroy_init(&rbtdb->common.ondest); + /* * Make a copy of the origin name. */ @@ -4709,8 +4714,6 @@ dns_rbtdb_create rbtdb->future_version = NULL; ISC_LIST_INIT(rbtdb->open_versions); - isc_ondestroy_init(&rbtdb->common.ondest); - rbtdb->common.magic = DNS_DB_MAGIC; rbtdb->common.impmagic = RBTDB_MAGIC;