From 25a807bcb9509c6fccfbbd9d02119772ccb0f23e Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Sat, 13 Feb 2016 19:29:34 +0100 Subject: Add checks on CRYPTO_new_ex_data return value Reviewed-by: Richard Levitte Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/996) --- crypto/ui/ui_lib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crypto/ui') diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index 7b08107f7a..cc5b5f1ecb 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -92,7 +92,10 @@ UI *UI_new_method(const UI_METHOD *method) else ret->meth = method; - CRYPTO_new_ex_data(CRYPTO_EX_INDEX_UI, ret, &ret->ex_data); + if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_UI, ret, &ret->ex_data)) { + OPENSSL_free(ret); + return NULL; + } return ret; } -- cgit v1.2.3