]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2140. [bug] libbind: missing unlock on pthread_key_create()
authorMark Andrews <marka@isc.org>
Mon, 26 Feb 2007 00:05:37 +0000 (00:05 +0000)
committerMark Andrews <marka@isc.org>
Mon, 26 Feb 2007 00:05:37 +0000 (00:05 +0000)
                        failures. [RT #16654]

CHANGES
lib/bind/irs/gai_strerror.c
lib/bind/irs/irs_data.c

diff --git a/CHANGES b/CHANGES
index 4db83a6f3ca56c40dd0e899c62b834664b97e6a3..7595c87641bfc46793c69741f0ff67ab89773db4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
 
index 0492f8f49aa8d9a9a1c1c873223a89509ccf53cd..06eeeb36a3f8cdc7da5ee270418ddea5a6bd29a8 100644 (file)
@@ -69,8 +69,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)
index 7904286db87ff35f56870ff8f363ae2262cddaa1..df7e4e134a48cbbeaaeb7cd6b80ca2921cfbe92f 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: irs_data.c,v 1.3.2.2.4.4 2006/03/10 00:17:21 marka Exp $";
+static const char rcsid[] = "$Id: irs_data.c,v 1.3.2.2.4.5 2007/02/26 00:05:37 marka Exp $";
 #endif
 
 #include "port_before.h"
@@ -131,8 +131,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)