isc_mem_attach(mctx, &sampledb->common.mctx);
dns_name_init(&sampledb->common.origin, NULL);
- CHECK(dns_name_dupwithoffsets(origin, mctx, &sampledb->common.origin));
+ dns_name_dupwithoffsets(origin, mctx, &sampledb->common.origin);
isc_refcount_init(&sampledb->common.references, 1);
*\li 'mctx' is a valid memory context.
*/
-isc_result_t
+void
dns_name_dupwithoffsets(const dns_name_t *source, isc_mem_t *mctx,
dns_name_t *target);
/*%<
}
}
-isc_result_t
+void
dns_name_dupwithoffsets(const dns_name_t *source, isc_mem_t *mctx,
dns_name_t *target) {
/*
} else {
set_offsets(target, target->offsets, NULL);
}
-
- return (ISC_R_SUCCESS);
}
void
}
if (name != target) {
- result = dns_name_dupwithoffsets(name, mctx, target);
+ dns_name_dupwithoffsets(name, mctx, target);
}
return (result);
}
unsigned int argc, char *argv[],
void *driverarg ISC_ATTR_UNUSED, dns_db_t **dbp) {
dns_qpdb_t *qpdb = NULL;
- isc_result_t result;
isc_mem_t *hmctx = mctx;
int i;
/*
* Make a copy of the origin name.
*/
- result = dns_name_dupwithoffsets(origin, mctx, &qpdb->common.origin);
- if (result != ISC_R_SUCCESS) {
- free_qpdb(qpdb, false);
- return (result);
- }
+ dns_name_dupwithoffsets(origin, mctx, &qpdb->common.origin);
/*
* Make the qp tries.
/*
* Make a copy of the origin name.
*/
- result = dns_name_dupwithoffsets(origin, mctx, &rbtdb->common.origin);
- if (result != ISC_R_SUCCESS) {
- free_rbtdb(rbtdb, false);
- return (result);
- }
+ dns_name_dupwithoffsets(origin, mctx, &rbtdb->common.origin);
/*
* Make the Red-Black Trees.
dns_sdlzcreateDBP(isc_mem_t *mctx, void *driverarg, void *dbdata,
const dns_name_t *name, dns_rdataclass_t rdclass,
dns_db_t **dbp) {
- isc_result_t result;
dns_sdlz_db_t *sdlzdb;
dns_sdlzimplementation_t *imp;
/* initialize and set origin */
dns_name_init(&sdlzdb->common.origin, NULL);
- result = dns_name_dupwithoffsets(name, mctx, &sdlzdb->common.origin);
- if (result != ISC_R_SUCCESS) {
- goto mem_cleanup;
- }
+ dns_name_dupwithoffsets(name, mctx, &sdlzdb->common.origin);
isc_refcount_init(&sdlzdb->common.references, 1);
sdlzdb->common.impmagic = SDLZDB_MAGIC;
*dbp = (dns_db_t *)sdlzdb;
- return (result);
-mem_cleanup:
- isc_mem_put(mctx, sdlzdb, sizeof(*sdlzdb));
- return (result);
+ return (ISC_R_SUCCESS);
}
static isc_result_t