2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 23:25:38 +00:00

1828. [bug] isc_rwlock_init() failed to properly cleanup if it

encountered a error. [RT #13549]
This commit is contained in:
Mark Andrews
2005-03-15 02:03:11 +00:00
parent 5d3083c4b5
commit 7d9b632906
2 changed files with 16 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
1828. [bug] isc_rwlock_init() failed to properly cleanup if it
encountered a error. [RT #13549]
1827. [bug] host: update usage message for '-a'. [RT #37116] 1827. [bug] host: update usage message for '-a'. [RT #37116]
1826. [bug] Missing DESTROYLOCK() in isc_mem_createx() on out 1826. [bug] Missing DESTROYLOCK() in isc_mem_createx() on out

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: rwlock.c,v 1.37 2004/03/05 05:10:49 marka Exp $ */ /* $Id: rwlock.c,v 1.38 2005/03/15 02:03:11 marka Exp $ */
#include <config.h> #include <config.h>
@@ -109,7 +109,9 @@ isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"), ISC_MSG_FAILED, "failed"),
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); result = ISC_R_UNEXPECTED;
goto destroy_lock;
} }
result = isc_condition_init(&rwl->writeable); result = isc_condition_init(&rwl->writeable);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
@@ -118,12 +120,20 @@ isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"), ISC_MSG_FAILED, "failed"),
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); result = ISC_R_UNEXPECTED;
goto destroy_rcond;
} }
rwl->magic = RWLOCK_MAGIC; rwl->magic = RWLOCK_MAGIC;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
destroy_rcond:
(void)isc_condition_destroy(&rwl->readable);
destroy_lock:
DESTROYLOCK(&rwl->lock);
return (result);
} }
static isc_result_t static isc_result_t