projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
GH773: Possible leak on CRYPTO_THREAD_lock_new failure
[openssl.git]
/
crypto
/
threads_pthread.c
diff --git
a/crypto/threads_pthread.c
b/crypto/threads_pthread.c
index 2b32e142ae091a80980f2fed11a88bee6612c499..edca77c0b972a207bb1b866ae8723225302bb70d 100644
(file)
--- 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;
}