2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

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

of memory. [RT #14995]
This commit is contained in:
Mark Andrews
2005-07-12 01:00:20 +00:00
parent 0563d476de
commit 18d0b5e54b
33 changed files with 376 additions and 380 deletions

View File

@@ -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;