In the previous refactoring, the findnodeintree() function could return
ISC_R_EXISTS (from dns_db_addnode() call) instead of ISC_R_SUCCESS
leading to node being attached, but never detached.
Change the ISC_R_EXISTS result code returned from dns_rbt_addnode() to
the ISC_R_SUCCESS in the findnodeintree() function (called internally by
dns_db_findnode() and dns_db_findnsec3node()).
if (tree == rbtdb->nsec3) {
node->nsec = DNS_RBT_NSEC_NSEC3;
}
- } else if (result != ISC_R_EXISTS) {
+ } else if (result == ISC_R_EXISTS) {
+ result = ISC_R_SUCCESS;
+ } else {
goto unlock;
}
}
reactivate_node(rbtdb, node, tlocktype);
*nodep = (dns_dbnode_t *)node;
-
unlock:
TREE_UNLOCK(&rbtdb->tree_lock, &tlocktype);