} else {
INSIST(nsecnode == NULL);
nsecnode = dns_qpdata_create(qpdb, name);
+ nsecnode->nsec = DNS_DB_NSEC_NSEC;
nsecresult = dns_qp_insert(qpdb->nsec, nsecnode, 0);
INSIST(nsecresult == ISC_R_SUCCESS);
+ dns_qpdata_detach(&nsecnode);
}
- nsecnode->nsec = DNS_DB_NSEC_NSEC;
node->nsec = DNS_DB_NSEC_HAS_NSEC;
done:
node = dns_qpdata_create(qpdb, name);
result = dns_qp_insert(qpdb->nsec3, node, 0);
INSIST(result == ISC_R_SUCCESS);
+ dns_qpdata_unref(node);
}
node->nsec = DNS_DB_NSEC_NSEC3;
} else if (rdataset->type == dns_rdatatype_nsec) {
node = dns_qpdata_create(qpdb, &foundname);
result = dns_qp_insert(qpdb->tree, node, 0);
INSIST(result == ISC_R_SUCCESS);
+ dns_qpdata_unref(node);
}
INSIST(result == ISC_R_SUCCESS);
if (result != ISC_R_SUCCESS) {
INSIST(node == NULL);
node = dns_qpdata_create(qpdb, name);
+ node->nsec = DNS_DB_NSEC_NORMAL;
result = dns_qp_insert(qpdb->tree, node, 0);
INSIST(result == ISC_R_SUCCESS);
- }
- if (result == ISC_R_SUCCESS) {
+ dns_qpdata_detach(&node);
+ } else if (result == ISC_R_SUCCESS) {
node->nsec = DNS_DB_NSEC_NORMAL;
}
}
unsigned int i;
unsigned int inactive = 0;
+ if (rbtdb->origin_node != NULL) {
+ dns_qpdata_detach(&rbtdb->origin_node);
+ }
+ if (rbtdb->nsec3_origin_node != NULL) {
+ dns_qpdata_detach(&rbtdb->nsec3_origin_node);
+ }
+
/* XXX check for open versions here */
if (qpdb->soanode != NULL) {
node = dns_qpdata_create(qpdb, name);
result = dns_qp_insert(tree, node, 0);
INSIST(result == ISC_R_SUCCESS);
+ dns_qpdata_unref(node);
if (tree == qpdb->tree) {
dns__qpzone_addwildcards(qpdb, name, true);
nsecnode->nsec = DNS_DB_NSEC_NSEC;
result = dns_qp_insert(qpdb->nsec, nsecnode, 0);
INSIST(result == ISC_R_SUCCESS);
+ dns_qpdata_detach(&nsecnode);
}
qpnode->nsec = DNS_DB_NSEC_HAS_NSEC;
}
void
dns_qpdata_destroy(dns_qpdata_t *data) {
- dns_name_free(data->name, data->mctx);
+ dns_slabheader_t *current = NULL, *next = NULL;
+
+ for (current = data->data; current != NULL; current = next) {
+ dns_slabheader_t *down = current->down, *down_next = NULL;
+
+ next = current->next;
+
+ for (down = current->down; down != NULL; down = down_next) {
+ down_next = down->down;
+ dns_slabheader_destroy(&down);
+ }
+
+ dns_slabheader_destroy(¤t);
+ }
+
isc_mem_putanddetach(&data->mctx, data, sizeof(dns_qpdata_t));
}