summaryrefslogtreecommitdiffstats
path: root/crypto/threads_pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/threads_pthread.c')
-rw-r--r--crypto/threads_pthread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 2b32e142ae..edca77c0b9 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -58,8 +58,10 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
if (lock == NULL)
return NULL;
- if (pthread_rwlock_init(lock, NULL) != 0)
+ if (pthread_rwlock_init(lock, NULL) != 0) {
+ OPENSSL_free(lock);
return NULL;
+ }
return lock;
}