if (tresult != DNS_R_CONTINUE) {
result = tresult;
search.chain.len = i - 1;
- dns_name_copy(&n->name, foundname);
node = n;
+ if (foundname != NULL) {
+ dns_name_copy(&node->name, foundname);
+ }
}
}
/*
* We have an exact match for the name, but there are no
* active rdatasets in the desired version. That means that
- * this node doesn't exist in the desired version.
- * If there's a node above this one, reassign the
- * foundname to the parent and treat this as a partial
- * match.
+ * this node doesn't exist in the desired version, and that
+ * we really have a partial match.
*/
if (!wild) {
- unsigned int len = search.chain.len - 1;
- if (len > 0) {
- NODE_UNLOCK(nlock, &nlocktype);
- dns_qpchain_node(&search.chain, len - 1, NULL,
- (void **)&node, NULL);
- dns_name_copy(&node->name, foundname);
- goto partial_match;
- }
+ NODE_UNLOCK(nlock, &nlocktype);
+ goto partial_match;
}
}