diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-02-13 19:29:34 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-04-28 14:37:41 -0400 |
commit | 25a807bcb9509c6fccfbbd9d02119772ccb0f23e (patch) | |
tree | 66ebeec7f6213a64318b8f26fd064860832bf0e1 /ssl/ssl_sess.c | |
parent | 8fdc99cb5dbf1a79b106cc635c82f59956e39108 (diff) | |
download | openssl-25a807bcb9509c6fccfbbd9d02119772ccb0f23e.tar.gz |
Add checks on CRYPTO_new_ex_data return value
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/996)
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index d5b7fe3310..3b9a9f7535 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -198,8 +198,11 @@ SSL_SESSION *SSL_SESSION_new(void) return NULL; } - CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data); - + if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data)) { + CRYPTO_THREAD_lock_free(ss->lock); + OPENSSL_free(ss); + return NULL; + } return ss; } |