From: Ondřej Surý Date: Wed, 1 Aug 2018 09:46:11 +0000 (+0200) Subject: isc_refcount_init() now doesn't return isc_result_t and asserts on failed initialization X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7580ac0f11806456cffbd647f33874ab1954747;p=thirdparty%2Fbind9.git isc_refcount_init() now doesn't return isc_result_t and asserts on failed initialization --- diff --git a/bin/tests/system/dyndb/driver/db.c b/bin/tests/system/dyndb/driver/db.c index af1626037a7..e9bdf27a25c 100644 --- a/bin/tests/system/dyndb/driver/db.c +++ b/bin/tests/system/dyndb/driver/db.c @@ -773,7 +773,7 @@ create_db(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, CHECK(dns_name_dupwithoffsets(origin, mctx, &sampledb->common.origin)); - CHECK(isc_refcount_init(&sampledb->refs, 1)); + isc_refcount_init(&sampledb->refs, 1); /* Translate instance name to instance pointer. */ sampledb->inst = driverarg; diff --git a/lib/dns/acl.c b/lib/dns/acl.c index 4bdcf1c06c6..f2f5532aaf9 100644 --- a/lib/dns/acl.c +++ b/lib/dns/acl.c @@ -50,11 +50,7 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target) { acl->name = NULL; - result = isc_refcount_init(&acl->refcount, 1); - if (result != ISC_R_SUCCESS) { - isc_mem_put(mctx, acl, sizeof(*acl)); - return (result); - } + isc_refcount_init(&acl->refcount, 1); result = dns_iptable_create(mctx, &acl->iptable); if (result != ISC_R_SUCCESS) { diff --git a/lib/dns/catz.c b/lib/dns/catz.c index 662497c64d2..d112284700f 100644 --- a/lib/dns/catz.c +++ b/lib/dns/catz.c @@ -568,9 +568,7 @@ dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm, if (result != ISC_R_SUCCESS) goto cleanup_newzones; - result = isc_refcount_init(&new_zones->refs, 1); - if (result != ISC_R_SUCCESS) - goto cleanup_mutex; + isc_refcount_init(&new_zones->refs, 1); result = isc_ht_init(&new_zones->zones, mctx, 4); if (result != ISC_R_SUCCESS) @@ -592,7 +590,6 @@ dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm, isc_ht_destroy(&new_zones->zones); cleanup_refcount: isc_refcount_destroy(&new_zones->refs); - cleanup_mutex: isc_mutex_destroy(&new_zones->lock); cleanup_newzones: isc_mem_put(mctx, new_zones, sizeof(*new_zones)); diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index 18c7a55657a..2fdc43c2308 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -214,7 +214,7 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path, memset(env, 0, sizeof(dns_dtenv_t)); - CHECK(isc_refcount_init(&env->refcount, 1)); + isc_refcount_init(&env->refcount, 1); CHECK(isc_stats_create(mctx, &env->stats, dns_dnstapcounter_max)); env->path = isc_mem_strdup(mctx, path); if (env->path == NULL) diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index aef5e96fb74..7071b30891c 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -1354,13 +1354,7 @@ get_key_struct(const dns_name_t *name, unsigned int alg, return (NULL); } - result = isc_refcount_init(&key->refs, 1); - if (result != ISC_R_SUCCESS) { - dns_name_free(key->key_name, mctx); - isc_mem_put(mctx, key->key_name, sizeof(dns_name_t)); - isc_mem_put(mctx, key, sizeof(dst_key_t)); - return (NULL); - } + isc_refcount_init(&key->refs, 1); isc_mem_attach(mctx, &key->mctx); key->key_alg = alg; key->key_flags = flags; diff --git a/lib/dns/keytable.c b/lib/dns/keytable.c index 464e0563013..75cbf4e1f32 100644 --- a/lib/dns/keytable.c +++ b/lib/dns/keytable.c @@ -89,15 +89,8 @@ dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep) { goto cleanup_rbt; } - result = isc_refcount_init(&keytable->active_nodes, 0); - if (result != ISC_R_SUCCESS) { - goto cleanup_rwlock; - } - - result = isc_refcount_init(&keytable->references, 1); - if (result != ISC_R_SUCCESS) { - goto cleanup_active_nodes; - } + isc_refcount_init(&keytable->active_nodes, 0); + isc_refcount_init(&keytable->references, 1); keytable->mctx = NULL; isc_mem_attach(mctx, &keytable->mctx); @@ -106,12 +99,6 @@ dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep) { return (ISC_R_SUCCESS); - cleanup_active_nodes: - isc_refcount_destroy(&keytable->active_nodes); - - cleanup_rwlock: - isc_rwlock_destroy(&keytable->rwlock); - cleanup_rbt: dns_rbt_destroy(&keytable->table); @@ -798,7 +785,6 @@ dns_keynode_trust(dns_keynode_t *keynode) { isc_result_t dns_keynode_create(isc_mem_t *mctx, dns_keynode_t **target) { - isc_result_t result; dns_keynode_t *knode; REQUIRE(target != NULL && *target == NULL); @@ -813,9 +799,7 @@ dns_keynode_create(isc_mem_t *mctx, dns_keynode_t **target) { knode->key = NULL; knode->next = NULL; - result = isc_refcount_init(&knode->refcount, 1); - if (result != ISC_R_SUCCESS) - return (result); + isc_refcount_init(&knode->refcount, 1); *target = knode; return (ISC_R_SUCCESS); diff --git a/lib/dns/nta.c b/lib/dns/nta.c index 6cede2a6a76..26f7033b229 100644 --- a/lib/dns/nta.c +++ b/lib/dns/nta.c @@ -308,7 +308,6 @@ static isc_result_t nta_create(dns_ntatable_t *ntatable, const dns_name_t *name, dns_nta_t **target) { - isc_result_t result; dns_nta_t *nta = NULL; dns_view_t *view; @@ -328,11 +327,7 @@ nta_create(dns_ntatable_t *ntatable, const dns_name_t *name, dns_rdataset_init(&nta->rdataset); dns_rdataset_init(&nta->sigrdataset); - result = isc_refcount_init(&nta->refcount, 1); - if (result != ISC_R_SUCCESS) { - isc_mem_put(view->mctx, nta, sizeof(dns_nta_t)); - return (result); - } + isc_refcount_init(&nta->refcount, 1); nta->name = dns_fixedname_initname(&nta->fn); dns_name_copy(name, nta->name, NULL); diff --git a/lib/dns/order.c b/lib/dns/order.c index 1dfada03f53..f3fb3c51e9d 100644 --- a/lib/dns/order.c +++ b/lib/dns/order.c @@ -49,7 +49,6 @@ struct dns_order { isc_result_t dns_order_create(isc_mem_t *mctx, dns_order_t **orderp) { dns_order_t *order; - isc_result_t result; REQUIRE(orderp != NULL && *orderp == NULL); @@ -60,11 +59,7 @@ dns_order_create(isc_mem_t *mctx, dns_order_t **orderp) { ISC_LIST_INIT(order->ents); /* Implicit attach. */ - result = isc_refcount_init(&order->references, 1); - if (result != ISC_R_SUCCESS) { - isc_mem_put(mctx, order, sizeof(*order)); - return (result); - } + isc_refcount_init(&order->references, 1); order->mctx = NULL; isc_mem_attach(mctx, &order->mctx); diff --git a/lib/dns/portlist.c b/lib/dns/portlist.c index 7de71785bb0..0a31ea30c8b 100644 --- a/lib/dns/portlist.c +++ b/lib/dns/portlist.c @@ -80,12 +80,7 @@ dns_portlist_create(isc_mem_t *mctx, dns_portlist_t **portlistp) { isc_mem_put(mctx, portlist, sizeof(*portlist)); return (result); } - result = isc_refcount_init(&portlist->refcount, 1); - if (result != ISC_R_SUCCESS) { - DESTROYLOCK(&portlist->lock); - isc_mem_put(mctx, portlist, sizeof(*portlist)); - return (result); - } + isc_refcount_init(&portlist->refcount, 1); portlist->list = NULL; portlist->allocated = 0; portlist->active = 0; diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 20a8c518d6a..f622d448a36 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -1268,11 +1268,9 @@ allocate_version(isc_mem_t *mctx, rbtdb_serial_t serial, if (version == NULL) return (NULL); version->serial = serial; - result = isc_refcount_init(&version->references, references); - if (result != ISC_R_SUCCESS) { - isc_mem_put(mctx, version, sizeof(*version)); - return (NULL); - } + + isc_refcount_init(&version->references, references); + result = isc_rwlock_init(&version->glue_rwlock, 0, 0); if (result != ISC_R_SUCCESS) { isc_refcount_destroy(&version->references); @@ -8360,9 +8358,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, for (i = 0; i < (int)(rbtdb->node_lock_count); i++) { result = NODE_INITLOCK(&rbtdb->node_locks[i].lock); if (result == ISC_R_SUCCESS) { - result = isc_refcount_init(&rbtdb->node_locks[i].references, 0); - if (result != ISC_R_SUCCESS) - NODE_DESTROYLOCK(&rbtdb->node_locks[i].lock); + isc_refcount_init(&rbtdb->node_locks[i].references, 0); } if (result != ISC_R_SUCCESS) { while (i-- > 0) { @@ -8471,11 +8467,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, /* * Misc. Initialization. */ - result = isc_refcount_init(&rbtdb->references, 1); - if (result != ISC_R_SUCCESS) { - free_rbtdb(rbtdb, false, NULL); - return (result); - } + isc_refcount_init(&rbtdb->references, 1); rbtdb->attributes = 0; rbtdb->task = NULL; rbtdb->serve_stale_ttl = 0; diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index 2010ca0a8b0..5fe57d82b65 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -1451,9 +1451,7 @@ dns_rpz_new_zones(dns_rpz_zones_t **rpzsp, char *rps_cstr, if (result != ISC_R_SUCCESS) goto cleanup_mutex; - result = isc_refcount_init(&zones->refs, 1); - if (result != ISC_R_SUCCESS) - goto cleanup_refcount; + isc_refcount_init(&zones->refs, 1); zones->rps_cstr = rps_cstr; zones->rps_cstr_size = rps_cstr_size; @@ -1490,7 +1488,6 @@ cleanup_rbt: isc_refcount_decrement(&zones->refs, NULL); isc_refcount_destroy(&zones->refs); -cleanup_refcount: DESTROYLOCK(&zones->maint_lock); cleanup_mutex: @@ -1519,9 +1516,7 @@ dns_rpz_new_zone(dns_rpz_zones_t *rpzs, dns_rpz_zone_t **rpzp) { } memset(zone, 0, sizeof(*zone)); - result = isc_refcount_init(&zone->refs, 1); - if (result != ISC_R_SUCCESS) - goto cleanup_refcount; + isc_refcount_init(&zone->refs, 1); result = isc_timer_create(rpzs->timermgr, isc_timertype_inactive, NULL, NULL, rpzs->updater, @@ -1576,7 +1571,6 @@ cleanup_timer: isc_refcount_decrement(&zone->refs, NULL); isc_refcount_destroy(&zone->refs); -cleanup_refcount: isc_mem_put(zone->rpzs->mctx, zone, sizeof(*zone)); return (result); diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index e6518e2f518..921ba942793 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -331,9 +331,8 @@ dns_tsigkey_createfromkey(const dns_name_t *name, const dns_name_t *algorithm, refs = 1; if (ring != NULL) refs++; - ret = isc_refcount_init(&tkey->refs, refs); - if (ret != ISC_R_SUCCESS) - goto cleanup_creator; + + isc_refcount_init(&tkey->refs, refs); tkey->generated = generated; tkey->inception = inception; @@ -373,7 +372,7 @@ dns_tsigkey_createfromkey(const dns_name_t *name, const dns_name_t *algorithm, while (refs-- > 0) isc_refcount_decrement(&tkey->refs, NULL); isc_refcount_destroy(&tkey->refs); - cleanup_creator: + if (tkey->key != NULL) dst_key_free(&tkey->key); if (tkey->creator != NULL) { diff --git a/lib/dns/view.c b/lib/dns/view.c index ea506249924..e0fe3ca9557 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -154,9 +154,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, view->rdclass = rdclass; view->frozen = false; view->task = NULL; - result = isc_refcount_init(&view->references, 1); - if (result != ISC_R_SUCCESS) - goto cleanup_fwdtable; + isc_refcount_init(&view->references, 1); view->weakrefs = 0; view->attributes = (DNS_VIEWATTR_RESSHUTDOWN|DNS_VIEWATTR_ADBSHUTDOWN| DNS_VIEWATTR_REQSHUTDOWN); @@ -316,7 +314,6 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, isc_refcount_decrement(&view->references, NULL); isc_refcount_destroy(&view->references); - cleanup_fwdtable: if (view->fwdtable != NULL) dns_fwdtable_destroy(&view->fwdtable); diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 2150a98f3f1..19de5a7e003 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -923,10 +923,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) { zone->db = NULL; zone->zmgr = NULL; ISC_LINK_INIT(zone, link); - result = isc_refcount_init(&zone->erefs, 1); /* Implicit attach. */ - if (result != ISC_R_SUCCESS) { - goto free_dblock; - } + isc_refcount_init(&zone->erefs, 1); /* Implicit attach. */ zone->irefs = 0; dns_name_init(&zone->origin, NULL); zone->strnamerd = NULL; @@ -1096,7 +1093,6 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) { isc_refcount_decrement(&zone->erefs, NULL); isc_refcount_destroy(&zone->erefs); - free_dblock: ZONEDB_DESTROYLOCK(&zone->dblock); free_mutex: diff --git a/lib/isc/Makefile.in b/lib/isc/Makefile.in index 785ac6892b2..6dff83c5489 100644 --- a/lib/isc/Makefile.in +++ b/lib/isc/Makefile.in @@ -56,7 +56,7 @@ OBJS = @ISC_EXTRA_OBJS@ pk11.@O@ pk11_result.@O@ \ md5.@O@ mem.@O@ mutexblock.@O@ \ netaddr.@O@ netscope.@O@ nonce.@O@ openssl_shim.@O@ pool.@O@ \ parseint.@O@ portset.@O@ quota.@O@ radix.@O@ random.@O@ \ - ratelimiter.@O@ refcount.@O@ region.@O@ regex.@O@ result.@O@ \ + ratelimiter.@O@ region.@O@ regex.@O@ result.@O@ \ rwlock.@O@ \ serial.@O@ sha1.@O@ sha2.@O@ sockaddr.@O@ stats.@O@ \ string.@O@ strtoul.@O@ symtab.@O@ task.@O@ taskpool.@O@ \ @@ -74,7 +74,7 @@ SRCS = @ISC_EXTRA_SRCS@ pk11.c pk11_result.c \ md5.c mem.c mutexblock.c \ netaddr.c netscope.c nonce.c openssl_shim.c pool.c \ parseint.c portset.c quota.c radix.c random.c \ - ratelimiter.c refcount.c region.c regex.c result.c rwlock.c \ + ratelimiter.c region.c regex.c result.c rwlock.c \ serial.c sha1.c sha2.c sockaddr.c stats.c string.c \ strtoul.c symtab.c task.c taskpool.c timer.c \ tm.c version.c diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h index 68942912760..3b151d033bf 100644 --- a/lib/isc/include/isc/refcount.h +++ b/lib/isc/include/isc/refcount.h @@ -43,7 +43,7 @@ ISC_LANG_BEGINDECLS */ /* - * isc_result_t + * void * isc_refcount_init(isc_refcount_t *ref, unsigned int n); * * Initialize the reference counter. There will be 'n' initial references. @@ -111,6 +111,8 @@ typedef struct isc_refcount { #if defined(ISC_REFCOUNT_HAVESTDATOMIC) +#define isc_refcount_init(rp, n) atomic_init(&(rp)->refs, n) + #define isc_refcount_current(rp) \ ((unsigned int)(atomic_load_explicit(&(rp)->refs, \ memory_order_relaxed))) @@ -150,6 +152,8 @@ typedef struct isc_refcount { #else /* ISC_REFCOUNT_HAVESTDATOMIC */ +#define isc_refcount_init(rp, n) isc_atomic_store(&(rp)->refs, n) + #define isc_refcount_current(rp) \ ((unsigned int)(isc_atomic_xadd(&(rp)->refs, 0))) #define isc_refcount_destroy(rp) ISC_REQUIRE(isc_refcount_current(rp) == 0) @@ -192,6 +196,12 @@ typedef struct isc_refcount { isc_mutex_t lock; } isc_refcount_t; +#define isc_refcount_init(rp, n) \ + do { \ + REQUIRE(isc_mutex_init(&(rp)->lock) == ISC_R_SUCCESS); \ + (rp)->refs = n; \ + } while(0); + /*% Destroys a reference counter. */ #define isc_refcount_destroy(rp) \ do { \ @@ -259,6 +269,7 @@ typedef struct isc_refcount { int refs; } isc_refcount_t; +#define isc_refcount_init(rp, n) ((rp)->refs = n) #define isc_refcount_destroy(rp) ISC_REQUIRE((rp)->refs == 0) #define isc_refcount_current(rp) ((unsigned int)((rp)->refs)) @@ -292,9 +303,6 @@ typedef struct isc_refcount { #endif /* ISC_PLATFORM_USETHREADS */ -isc_result_t -isc_refcount_init(isc_refcount_t *ref, unsigned int n); - ISC_LANG_ENDDECLS #endif /* ISC_REFCOUNT_H */ diff --git a/lib/isc/refcount.c b/lib/isc/refcount.c deleted file mode 100644 index 033af7b4cd8..00000000000 --- a/lib/isc/refcount.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - - -#include - -#include - -#include -#include -#include -#include - -isc_result_t -isc_refcount_init(isc_refcount_t *ref, unsigned int n) { - REQUIRE(ref != NULL); - - ref->refs = n; -#if defined(ISC_PLATFORM_USETHREADS) && !defined(ISC_REFCOUNT_HAVEATOMIC) - return (isc_mutex_init(&ref->lock)); -#else - return (ISC_R_SUCCESS); -#endif -} diff --git a/lib/isc/win32/libisc.def.in b/lib/isc/win32/libisc.def.in index aa4e71178f8..9758c8284eb 100644 --- a/lib/isc/win32/libisc.def.in +++ b/lib/isc/win32/libisc.def.in @@ -520,7 +520,6 @@ isc_ratelimiter_setpertic isc_ratelimiter_setpushpop isc_ratelimiter_shutdown isc_ratelimiter_stall -isc_refcount_init isc_regex_validate isc_region_compare isc_resource_getcurlimit diff --git a/lib/isccfg/aclconf.c b/lib/isccfg/aclconf.c index 01963240155..e713f119816 100644 --- a/lib/isccfg/aclconf.c +++ b/lib/isccfg/aclconf.c @@ -36,7 +36,6 @@ isc_result_t cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **ret) { - isc_result_t result; cfg_aclconfctx_t *actx; REQUIRE(mctx != NULL); @@ -46,9 +45,7 @@ cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **ret) { if (actx == NULL) return (ISC_R_NOMEMORY); - result = isc_refcount_init(&actx->references, 1); - if (result != ISC_R_SUCCESS) - goto cleanup; + isc_refcount_init(&actx->references, 1); actx->mctx = NULL; isc_mem_attach(mctx, &actx->mctx); @@ -60,10 +57,6 @@ cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **ret) { *ret = actx; return (ISC_R_SUCCESS); - - cleanup: - isc_mem_put(mctx, actx, sizeof(*actx)); - return (result); } void diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index af7755c40ad..b4ae56aa889 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -451,11 +451,7 @@ cfg_parser_create(isc_mem_t *mctx, isc_log_t *lctx, cfg_parser_t **ret) { pctx->mctx = NULL; isc_mem_attach(mctx, &pctx->mctx); - result = isc_refcount_init(&pctx->references, 1); - if (result != ISC_R_SUCCESS) { - isc_mem_putanddetach(&pctx->mctx, pctx, sizeof(*pctx)); - return (result); - } + isc_refcount_init(&pctx->references, 1); pctx->lctx = lctx; pctx->lexer = NULL; @@ -3064,7 +3060,6 @@ cfg_obj_line(const cfg_obj_t *obj) { isc_result_t cfg_create_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { - isc_result_t result; cfg_obj_t *obj; REQUIRE(pctx != NULL); @@ -3080,11 +3075,8 @@ cfg_create_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { obj->line = pctx->line; obj->pctx = pctx; - result = isc_refcount_init(&obj->references, 1); - if (result != ISC_R_SUCCESS) { - isc_mem_put(pctx->mctx, obj, sizeof(cfg_obj_t)); - return (result); - } + isc_refcount_init(&obj->references, 1); + *ret = obj; return (ISC_R_SUCCESS); diff --git a/lib/ns/server.c b/lib/ns/server.c index cb489abc833..1278dd62671 100644 --- a/lib/ns/server.c +++ b/lib/ns/server.c @@ -50,9 +50,7 @@ ns_server_create(isc_mem_t *mctx, ns_matchview_t matchingview, isc_mem_attach(mctx, &sctx->mctx); - result = isc_refcount_init(&sctx->references, 1); - if (result != ISC_R_SUCCESS) - goto cleanup; + isc_refcount_init(&sctx->references, 1); CHECKFATAL(isc_quota_init(&sctx->xfroutquota, 10)); CHECKFATAL(isc_quota_init(&sctx->tcpquota, 10)); @@ -113,11 +111,6 @@ ns_server_create(isc_mem_t *mctx, ns_matchview_t matchingview, *sctxp = sctx; return (ISC_R_SUCCESS); - - cleanup: - isc_mem_putanddetach(&sctx->mctx, sctx, sizeof(*sctx)); - - return (result); } void