aboutsummaryrefslogtreecommitdiff
path: root/lib/bind/irs/gai_strerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bind/irs/gai_strerror.c')
-rw-r--r--lib/bind/irs/gai_strerror.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bind/irs/gai_strerror.c b/lib/bind/irs/gai_strerror.c
index 0492f8f49aa8..e8921ea43246 100644
--- a/lib/bind/irs/gai_strerror.c
+++ b/lib/bind/irs/gai_strerror.c
@@ -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) {
+ (void)pthread_mutex_unlock(&lock);
goto unknown;
+ }
once = 1;
}
if (pthread_mutex_unlock(&lock) != 0)