aboutsummaryrefslogtreecommitdiff
path: root/crypto/threads_win.c
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-03-01 21:59:48 +0100
committerRich Salz <rsalz@akamai.com>2016-03-03 19:47:01 -0500
commit0b2fc9286f84d12f2f103b0d29c9e6e1e2a6bf87 (patch)
tree4cf88480ad2081b0588ec486e1a9d7f7ae53b4d0 /crypto/threads_win.c
parente257b2c2aeeb010693ae79458751a030a7961b84 (diff)
downloadopenssl-0b2fc9286f84d12f2f103b0d29c9e6e1e2a6bf87.zip
openssl-0b2fc9286f84d12f2f103b0d29c9e6e1e2a6bf87.tar.gz
openssl-0b2fc9286f84d12f2f103b0d29c9e6e1e2a6bf87.tar.bz2
GH773: Possible leak on CRYPTO_THREAD_lock_new failure
Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/threads_win.c')
-rw-r--r--crypto/threads_win.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/threads_win.c b/crypto/threads_win.c
index bee628f..741e8f8 100644
--- a/crypto/threads_win.c
+++ b/crypto/threads_win.c
@@ -59,8 +59,10 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
return NULL;
/* 0x400 is the spin count value suggested in the documentation */
- if (!InitializeCriticalSectionAndSpinCount(lock, 0x400))
+ if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {
+ OPENSSL_free(lock);
return NULL;
+ }
return lock;
}