From 0b2fc9286f84d12f2f103b0d29c9e6e1e2a6bf87 Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Tue, 1 Mar 2016 21:59:48 +0100 Subject: GH773: Possible leak on CRYPTO_THREAD_lock_new failure Signed-off-by: Rich Salz Reviewed-by: Matt Caswell --- crypto/threads_win.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crypto/threads_win.c') diff --git a/crypto/threads_win.c b/crypto/threads_win.c index bee628ff81..741e8f827e 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; } -- cgit v1.2.3