diff --git a/bin/tests/system/dyndb/driver/db.c b/bin/tests/system/dyndb/driver/db.c index 90ddac13d1..521327d125 100644 --- a/bin/tests/system/dyndb/driver/db.c +++ b/bin/tests/system/dyndb/driver/db.c @@ -614,7 +614,7 @@ create_db(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, 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); diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index 7a3ae95477..a9a15ae5de 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -1078,7 +1078,7 @@ dns_name_dup(const dns_name_t *source, isc_mem_t *mctx, dns_name_t *target); *\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); /*%< diff --git a/lib/dns/name.c b/lib/dns/name.c index 6149a11445..ce3b78be9b 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -1784,7 +1784,7 @@ dns_name_dup(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) { /* @@ -1819,8 +1819,6 @@ dns_name_dupwithoffsets(const dns_name_t *source, isc_mem_t *mctx, } else { set_offsets(target, target->offsets, NULL); } - - return (ISC_R_SUCCESS); } void @@ -1999,7 +1997,7 @@ dns_name_fromstring(dns_name_t *target, const char *src, } if (name != target) { - result = dns_name_dupwithoffsets(name, mctx, target); + dns_name_dupwithoffsets(name, mctx, target); } return (result); } diff --git a/lib/dns/qpcache.c b/lib/dns/qpcache.c index 36b55d80a6..0810e19069 100644 --- a/lib/dns/qpcache.c +++ b/lib/dns/qpcache.c @@ -3856,7 +3856,6 @@ dns__qpcache_create(isc_mem_t *mctx, const dns_name_t *origin, 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; @@ -3951,11 +3950,7 @@ dns__qpcache_create(isc_mem_t *mctx, const dns_name_t *origin, /* * 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. diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 92fb702575..0dee744b7a 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -3958,11 +3958,7 @@ dns__rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, /* * 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. diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 6905e2185e..b42b0a0dfd 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -1357,7 +1357,6 @@ static isc_result_t 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; @@ -1379,10 +1378,7 @@ dns_sdlzcreateDBP(isc_mem_t *mctx, void *driverarg, void *dbdata, /* 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); @@ -1394,10 +1390,7 @@ dns_sdlzcreateDBP(isc_mem_t *mctx, void *driverarg, void *dbdata, 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