diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 5814f3e6a5..70893ee029 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -1745,18 +1745,15 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) { switch (node->nsec) { case DNS_RBT_NSEC_NORMAL: + result = dns_rbt_deletenode(rbtdb->tree, node, false); + break; + case DNS_RBT_NSEC_HAS_NSEC: /* * Though this may be wasteful, it has to be done before * node is deleted. */ name = dns_fixedname_initname(&fname); dns_rbt_fullnamefromnode(node, name); - - result = dns_rbt_deletenode(rbtdb->tree, node, false); - break; - case DNS_RBT_NSEC_HAS_NSEC: - name = dns_fixedname_initname(&fname); - dns_rbt_fullnamefromnode(node, name); /* * Delete the corresponding node from the auxiliary NSEC * tree before deleting from the main tree.