Commit 18d0b5e5 authored by Mark Andrews's avatar Mark Andrews

1900. [port] freebsd: pthread_mutex_init can fail if it runs out

                        of memory. [RT #14995]
parent 0563d476
1900. [port] freebsd: pthread_mutex_init can fail if it runs out
of memory. [RT #14995]
1899. [func] Raise the UDP recieve buffer size to 32k if it is
less than 32k. [RT #14953]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwresd.c,v 1.48 2005/04/29 00:22:29 marka Exp $ */
/* $Id: lwresd.c,v 1.49 2005/07/12 01:00:13 marka Exp $ */
/*! \file
* \brief
......@@ -511,13 +511,19 @@ listener_create(isc_mem_t *mctx, ns_lwresd_t *lwresd,
ns_lwreslistener_t **listenerp)
{
ns_lwreslistener_t *listener;
isc_result_t result;
REQUIRE(listenerp != NULL && *listenerp == NULL);
listener = isc_mem_get(mctx, sizeof(ns_lwreslistener_t));
if (listener == NULL)
return (ISC_R_NOMEMORY);
RUNTIME_CHECK(isc_mutex_init(&listener->lock) == ISC_R_SUCCESS);
result = isc_mutex_init(&listener->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, listener, sizeof(ns_lwreslistener_t));
return (result);
}
listener->magic = LWRESLISTENER_MAGIC;
listener->refs = 1;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwsearch.c,v 1.10 2005/04/29 00:22:29 marka Exp $ */
/* $Id: lwsearch.c,v 1.11 2005/07/12 01:00:13 marka Exp $ */
/*! \file */
......@@ -40,6 +40,7 @@
isc_result_t
ns_lwsearchlist_create(isc_mem_t *mctx, ns_lwsearchlist_t **listp) {
ns_lwsearchlist_t *list;
isc_result_t result;
REQUIRE(mctx != NULL);
REQUIRE(listp != NULL && *listp == NULL);
......@@ -48,7 +49,11 @@ ns_lwsearchlist_create(isc_mem_t *mctx, ns_lwsearchlist_t **listp) {
if (list == NULL)
return (ISC_R_NOMEMORY);
RUNTIME_CHECK(isc_mutex_init(&list->lock) == ISC_R_SUCCESS);
result = isc_mutex_init(&list->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, list, sizeof(ns_lwsearchlist_t));
return (result);
}
list->mctx = NULL;
isc_mem_attach(mctx, &list->mctx);
list->refs = 1;
......
......@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acache.c,v 1.9 2005/06/04 05:32:46 jinmei Exp $ */
/* $Id: acache.c,v 1.10 2005/07/12 01:00:13 marka Exp $ */
#include <config.h>
......@@ -495,13 +495,8 @@ acache_cleaner_init(dns_acache_t *acache, isc_timermgr_t *timermgr,
ATRACE("acache cleaner init");
result = isc_mutex_init(&cleaner->lock);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
dns_result_totext(result));
result = ISC_R_UNEXPECTED;
if (result != ISC_R_SUCCESS)
goto fail;
}
cleaner->increment = DNS_ACACHE_CLEANERINCREMENT;
cleaner->state = cleaner_s_idle;
......@@ -949,15 +944,18 @@ dns_acache_create(dns_acache_t **acachep, isc_mem_t *mctx,
ATRACE("create");
isc_refcount_init(&acache->refs, 1);
result = isc_refcount_init(&acache->refs, 1);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, acache, sizeof(*acache));
return (result);
}
result = isc_mutex_init(&acache->lock);
if (result != ISC_R_SUCCESS) {
isc_refcount_decrement(&acache->refs, NULL);
isc_refcount_destroy(&acache->refs);
isc_mem_put(mctx, acache, sizeof(*acache));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
return (result);
}
acache->mctx = NULL;
......@@ -999,6 +997,8 @@ dns_acache_create(dns_acache_t **acachep, isc_mem_t *mctx,
if (acache->task != NULL)
isc_task_detach(&acache->task);
DESTROYLOCK(&acache->lock);
isc_refcount_decrement(&acache->refs, NULL);
isc_refcount_destroy(&acache->refs);
isc_mem_put(mctx, acache, sizeof(*acache));
isc_mem_detach(&mctx);
......@@ -1232,10 +1232,7 @@ dns_acache_createentry(dns_acache_t *acache, dns_db_t *origdb,
result = ACACHE_INITLOCK(&newentry->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(acache->mctx, newentry, sizeof(*newentry));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
return (result);
};
isc_refcount_init(&newentry->references, 1);
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acl.c,v 1.27 2005/04/29 00:22:43 marka Exp $ */
/* $Id: acl.c,v 1.28 2005/07/12 01:00:14 marka Exp $ */
/*! \file */
......@@ -43,7 +43,11 @@ dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target) {
return (ISC_R_NOMEMORY);
acl->mctx = mctx;
acl->name = NULL;
isc_refcount_init(&acl->refcount, 1);
result = isc_refcount_init(&acl->refcount, 1);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, acl, sizeof(*acl));
return (result);
}
acl->elements = NULL;
acl->alloc = 0;
acl->length = 0;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: adb.c,v 1.222 2005/06/23 04:22:01 marka Exp $ */
/* $Id: adb.c,v 1.223 2005/07/12 01:00:14 marka Exp $ */
/*! \file
*
......@@ -1442,8 +1442,6 @@ new_adbfind(dns_adb_t *adb) {
*/
result = isc_mutex_init(&h->lock);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init failed in new_adbfind()");
isc_mempool_put(adb->ahmp, h);
return (NULL);
}
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cache.c,v 1.60 2005/04/27 04:56:44 sra Exp $ */
/* $Id: cache.c,v 1.61 2005/07/12 01:00:14 marka Exp $ */
/*! \file */
......@@ -185,22 +185,12 @@ dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
isc_mem_attach(mctx, &cache->mctx);
result = isc_mutex_init(&cache->lock);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
dns_result_totext(result));
result = ISC_R_UNEXPECTED;
if (result != ISC_R_SUCCESS)
goto cleanup_mem;
}
result = isc_mutex_init(&cache->filelock);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
dns_result_totext(result));
result = ISC_R_UNEXPECTED;
if (result != ISC_R_SUCCESS)
goto cleanup_lock;
}
cache->references = 1;
cache->live_tasks = 0;
......@@ -495,13 +485,8 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr,
isc_result_t result;
result = isc_mutex_init(&cleaner->lock);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
dns_result_totext(result));
result = ISC_R_UNEXPECTED;
if (result != ISC_R_SUCCESS)
goto fail;
}
cleaner->increment = DNS_CACHE_CLEANERINCREMENT;
cleaner->state = cleaner_s_idle;
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: dbtable.c,v 1.30 2005/04/29 00:22:44 marka Exp $
* $Id: dbtable.c,v 1.31 2005/07/12 01:00:14 marka Exp $
*/
/*! \file
......@@ -87,7 +87,6 @@ dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
result = isc_rwlock_init(&dbtable->tree_lock, 0, 0);
if (result != ISC_R_SUCCESS)
goto clean3;
dbtable->default_db = NULL;
dbtable->mctx = mctx;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dispatch.c,v 1.123 2005/04/27 04:56:45 sra Exp $ */
/* $Id: dispatch.c,v 1.124 2005/07/12 01:00:14 marka Exp $ */
/*! \file */
......@@ -1357,6 +1357,7 @@ qid_allocate(dns_dispatchmgr_t *mgr, unsigned int buckets,
{
dns_qid_t *qid;
unsigned int i;
isc_result_t result;
REQUIRE(VALID_DISPATCHMGR(mgr));
REQUIRE(buckets < 2097169); /* next prime > 65536 * 32 */
......@@ -1374,12 +1375,12 @@ qid_allocate(dns_dispatchmgr_t *mgr, unsigned int buckets,
return (ISC_R_NOMEMORY);
}
if (isc_mutex_init(&qid->lock) != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_mutex_init failed");
result = isc_mutex_init(&qid->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mgr->mctx, qid->qid_table,
buckets * sizeof(dns_displist_t));
isc_mem_put(mgr->mctx, qid, sizeof(*qid));
return (ISC_R_UNEXPECTED);
return (result);
}
for (i = 0; i < buckets; i++)
......@@ -1432,7 +1433,7 @@ dispatch_allocate(dns_dispatchmgr_t *mgr, unsigned int maxrequests,
dns_dispatch_t **dispp)
{
dns_dispatch_t *disp;
isc_result_t res;
isc_result_t result;
REQUIRE(VALID_DISPATCHMGR(mgr));
REQUIRE(dispp != NULL && *dispp == NULL);
......@@ -1463,15 +1464,13 @@ dispatch_allocate(dns_dispatchmgr_t *mgr, unsigned int maxrequests,
disp->tcpbuffers = 0;
disp->qid = NULL;
if (isc_mutex_init(&disp->lock) != ISC_R_SUCCESS) {
res = ISC_R_UNEXPECTED;
UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_mutex_init failed");
result = isc_mutex_init(&disp->lock);
if (result != ISC_R_SUCCESS)
goto deallocate;
}
disp->failsafe_ev = allocate_event(disp);
if (disp->failsafe_ev == NULL) {
res = ISC_R_NOMEMORY;
result = ISC_R_NOMEMORY;
goto kill_lock;
}
......@@ -1488,7 +1487,7 @@ dispatch_allocate(dns_dispatchmgr_t *mgr, unsigned int maxrequests,
deallocate:
isc_mempool_put(mgr->dpool, disp);
return (res);
return (result);
}
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: forward.c,v 1.9 2005/04/27 04:56:46 sra Exp $ */
/* $Id: forward.c,v 1.10 2005/07/12 01:00:15 marka Exp $ */
/*! \file */
......@@ -64,13 +64,8 @@ dns_fwdtable_create(isc_mem_t *mctx, dns_fwdtable_t **fwdtablep) {
goto cleanup_fwdtable;
result = isc_rwlock_init(&fwdtable->rwlock, 0, 0);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_rwlock_init() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
if (result != ISC_R_SUCCESS)
goto cleanup_rbt;
}
fwdtable->mctx = NULL;
isc_mem_attach(mctx, &fwdtable->mctx);
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: keytable.c,v 1.30 2005/04/29 00:22:47 marka Exp $ */
/* $Id: keytable.c,v 1.31 2005/07/12 01:00:15 marka Exp $ */
/*! \file */
......@@ -89,22 +89,12 @@ dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep) {
goto cleanup_keytable;
result = isc_mutex_init(&keytable->lock);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
if (result != ISC_R_SUCCESS)
goto cleanup_rbt;
}
result = isc_rwlock_init(&keytable->rwlock, 0, 0);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_rwlock_init() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
if (result != ISC_R_SUCCESS)
goto cleanup_lock;
}
keytable->mctx = mctx;
keytable->active_nodes = 0;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.c,v 1.155 2005/06/20 01:03:53 marka Exp $ */
/* $Id: master.c,v 1.156 2005/07/12 01:00:15 marka Exp $ */
/*! \file */
......@@ -530,10 +530,7 @@ loadctx_create(dns_masterformat_t format, isc_mem_t *mctx,
result = isc_mutex_init(&lctx->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, lctx, sizeof(*lctx));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
return (result);
}
lctx->inc = NULL;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: order.c,v 1.7 2005/04/29 00:22:49 marka Exp $ */
/* $Id: order.c,v 1.8 2005/07/12 01:00:15 marka Exp $ */
/*! \file */
......@@ -55,6 +55,8 @@ 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);
order = isc_mem_get(mctx, sizeof(*order));
......@@ -62,7 +64,13 @@ dns_order_create(isc_mem_t *mctx, dns_order_t **orderp) {
return (ISC_R_NOMEMORY);
ISC_LIST_INIT(order->ents);
isc_refcount_init(&order->references, 1); /* Implicit attach. */
/* Implicit attach. */
result = isc_refcount_init(&order->references, 1);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, order, sizeof(*order));
return (result);
}
order->mctx = NULL;
isc_mem_attach(mctx, &order->mctx);
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: portlist.c,v 1.8 2005/04/29 00:22:49 marka Exp $ */
/* $Id: portlist.c,v 1.9 2005/07/12 01:00:15 marka Exp $ */
/*! \file */
......@@ -81,12 +81,14 @@ dns_portlist_create(isc_mem_t *mctx, dns_portlist_t **portlistp) {
result = isc_mutex_init(&portlist->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, portlist, sizeof(*portlist));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
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;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbtdb.c,v 1.212 2005/07/07 02:51:52 marka Exp $ */
/* $Id: rbtdb.c,v 1.213 2005/07/12 01:00:15 marka Exp $ */
/*! \file */
......@@ -713,13 +713,18 @@ static inline rbtdb_version_t *
allocate_version(isc_mem_t *mctx, rbtdb_serial_t serial,
unsigned int references, isc_boolean_t writer)
{
isc_result_t result;
rbtdb_version_t *version;
version = isc_mem_get(mctx, sizeof(*version));
if (version == NULL)
return (NULL);
version->serial = serial;
isc_refcount_init(&version->references, references);
result = isc_refcount_init(&version->references, references);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, version, sizeof(*version));
return (NULL);
}
version->writer = writer;
version->commit_ok = ISC_FALSE;
ISC_LIST_INIT(version->changed_list);
......@@ -5449,6 +5454,7 @@ dns_rbtdb_create
rbtdb = isc_mem_get(mctx, sizeof(*rbtdb));
if (rbtdb == NULL)
return (ISC_R_NOMEMORY);
memset(rbtdb, '\0', sizeof(*rbtdb));
dns_name_init(&rbtdb->common.origin, NULL);
rbtdb->common.attributes = 0;
......@@ -5465,23 +5471,12 @@ dns_rbtdb_create
rbtdb->nodemctxs = NULL;
result = RBTDB_INITLOCK(&rbtdb->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, rbtdb, sizeof(*rbtdb));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"RBTDB_INITLOCK() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
if (result != ISC_R_SUCCESS)
goto cleanup_rbtdb;
result = isc_rwlock_init(&rbtdb->tree_lock, 0, 0);
if (result != ISC_R_SUCCESS) {
RBTDB_DESTROYLOCK(&rbtdb->lock);
isc_mem_put(mctx, rbtdb, sizeof(*rbtdb));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_rwlock_init() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
if (result != ISC_R_SUCCESS)
goto cleanup_lock;
INSIST(rbtdb->node_lock_count < (1 << DNS_RBT_LOCKLENGTH));
......@@ -5489,47 +5484,54 @@ dns_rbtdb_create
rbtdb->node_lock_count = DEFAULT_NODE_LOCK_COUNT;
rbtdb->node_locks = isc_mem_get(mctx, rbtdb->node_lock_count *
sizeof(rbtdb_nodelock_t));
if (rbtdb->node_locks == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup_tree_lock;
}
rbtdb->active = rbtdb->node_lock_count;
if (IS_CACHE(rbtdb)) {
rbtdb->nodemctxs = isc_mem_get(mctx,
sizeof(isc_mem_t *) *
rbtdb->node_lock_count);
if (rbtdb->nodemctxs == NULL)
INSIST(0); /* XXXJT: cleanup */
for (i = 0; i < (int)(rbtdb->node_lock_count); i++)
if (rbtdb->nodemctxs == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup_node_locks;
}
for (i = 0; i < (int)(rbtdb->node_lock_count); i++) {
rbtdb->nodemctxs[i] = NULL;
}
result = isc_mem_create(0, 0, &rbtdb->nodemctxs[i]);
if (result != ISC_R_SUCCESS) {
while (i-- > 0)
isc_mem_detach(&rbtdb->nodemctxs[i]);
isc_mem_put(mctx, rbtdb->nodemctxs,
sizeof(isc_mem_t *) *
rbtdb->node_lock_count);
goto cleanup_node_locks;
}
}
} else
rbtdb->nodemctxs = NULL;
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);
}
if (result != ISC_R_SUCCESS) {
i--;
while (i >= 0) {
while (i-- > 0) {
NODE_DESTROYLOCK(&rbtdb->node_locks[i].lock);
i--;
isc_refcount_decrement(&rbtdb->node_locks[i].references, NULL);
isc_refcount_destroy(&rbtdb->node_locks[i].references);
}
isc_mem_put(mctx, rbtdb->node_locks,
rbtdb->node_lock_count *
sizeof(rbtdb_nodelock_t));
isc_rwlock_destroy(&rbtdb->tree_lock);
RBTDB_DESTROYLOCK(&rbtdb->lock);
isc_mem_put(mctx, rbtdb, sizeof(*rbtdb));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
goto cleanup_nodemctxs;
}
isc_refcount_init(&rbtdb->node_locks[i].references, 0);
rbtdb->node_locks[i].exiting = ISC_FALSE;
if (IS_CACHE(rbtdb)) {
result = isc_mem_create(0, 0, &rbtdb->nodemctxs[i]);
if (result != ISC_R_SUCCESS)
INSIST(0); /* XXXJT: cleanup */
}
}
/*
* Attach to the mctx. The database will persist so long as there
* are references to it, and attaching to the mctx ensures that our
......@@ -5573,7 +5575,7 @@ dns_rbtdb_create
* the top-of-zone node can never be deleted, nor can its address
* change.
*/
if (! IS_CACHE(rbtdb)) {
if (!IS_CACHE(rbtdb)) {
rbtdb->origin_node = NULL;
result = dns_rbt_addnode(rbtdb->tree, &rbtdb->common.origin,
&rbtdb->origin_node);
......@@ -5601,7 +5603,11 @@ dns_rbtdb_create
/*
* Misc. Initialization.
*/
isc_refcount_init(&rbtdb->references, 1);
result = isc_refcount_init(&rbtdb->references, 1);
if (result != ISC_R_SUCCESS) {
free_rbtdb(rbtdb, ISC_FALSE, NULL);
return (result);
}
rbtdb->attributes = 0;
rbtdb->secure = ISC_FALSE;
rbtdb->overmem = ISC_FALSE;
......@@ -5615,6 +5621,8 @@ dns_rbtdb_create
rbtdb->next_serial = 2;
rbtdb->current_version = allocate_version(mctx, 1, 1, ISC_FALSE);
if (rbtdb->current_version == NULL) {
isc_refcount_decrement(&rbtdb->references, NULL);
isc_refcount_destroy(&rbtdb->references);
free_rbtdb(rbtdb, ISC_FALSE, NULL);
return (ISC_R_NOMEMORY);