2140. [bug] libbind: missing unlock on pthread_key_create()

failures. [RT #16654]
This commit is contained in:
Mark Andrews 2007-02-25 23:46:58 +00:00
parent 214649f6ee
commit 8363ddb32d
3 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,6 @@
2140. [bug] libbind: missing unlock on pthread_key_create()
failures. [RT #16654]
2139. [bug] dns_view_find() was being called with wrong type
in adb.c. [RT #16670]

View file

@ -68,8 +68,10 @@ gai_strerror(int ecode) {
if (pthread_mutex_lock(&lock) != 0)
goto unknown;
if (!once) {
if (pthread_key_create(&key, free) != 0)
if (pthread_key_create(&key, free) != 0) {
pthread_mutex_unlock(&lock);
goto unknown;
}
once = 1;
}
if (pthread_mutex_unlock(&lock) != 0)

View file

@ -16,7 +16,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: irs_data.c,v 1.10 2006/03/09 23:57:56 marka Exp $";
static const char rcsid[] = "$Id: irs_data.c,v 1.11 2007/02/25 23:46:58 marka Exp $";
#endif
#include "port_before.h"
@ -132,8 +132,10 @@ net_data_init(const char *conf_file) {
if (pthread_mutex_lock(&keylock) != 0)
return (NULL);
if (!once) {
if (pthread_key_create(&key, net_data_destroy) != 0)
if (pthread_key_create(&key, net_data_destroy) != 0) {
pthread_mutex_unlock(&keylock);
return (NULL);
}
once = 1;
}
if (pthread_mutex_unlock(&keylock) != 0)