From: Mark Andrews Date: Sat, 26 Mar 2016 21:25:44 +0000 (+1100) Subject: attempt to create a node at the flushtree name X-Git-Tag: v9.11.0a2~97 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=dd185fb371632b9cf1b7be3097960185c9645a09;p=thirdparty%2Fbind9.git attempt to create a node at the flushtree name --- diff --git a/lib/dns/cache.c b/lib/dns/cache.c index f95e9e3fe8e..a21dda546a8 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -1216,10 +1216,16 @@ static isc_result_t cleartree(dns_db_t *db, dns_name_t *name) { isc_result_t result, answer = ISC_R_SUCCESS; dns_dbiterator_t *iter = NULL; - dns_dbnode_t *node = NULL; + dns_dbnode_t *node = NULL, *top = NULL; dns_fixedname_t fnodename; dns_name_t *nodename; + /* + * Create the node if it doesn't exist so dns_dbiterator_seek() + * can find it. We will continue even if this fails. + */ + (void)dns_db_findnode(db, name, ISC_TRUE, &top); + dns_fixedname_init(&fnodename); nodename = dns_fixedname_name(&fnodename); @@ -1264,6 +1270,8 @@ cleartree(dns_db_t *db, dns_name_t *name) { dns_db_detachnode(db, &node); if (iter != NULL) dns_dbiterator_destroy(&iter); + if (top != NULL) + dns_db_detachnode(db, &top); return (answer); }