summaryrefslogtreecommitdiffstats
path: root/crypto/engine
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-02-13 19:29:34 +0100
committerRich Salz <rsalz@openssl.org>2016-04-28 14:37:41 -0400
commit25a807bcb9509c6fccfbbd9d02119772ccb0f23e (patch)
tree66ebeec7f6213a64318b8f26fd064860832bf0e1 /crypto/engine
parent8fdc99cb5dbf1a79b106cc635c82f59956e39108 (diff)
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 'crypto/engine')
-rw-r--r--crypto/engine/eng_lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c
index d0bc716bb3..5bcd24bcf8 100644
--- a/crypto/engine/eng_lib.c
+++ b/crypto/engine/eng_lib.c
@@ -83,7 +83,10 @@ ENGINE *ENGINE_new(void)
}
ret->struct_ref = 1;
engine_ref_debug(ret, 0, 1);
- CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data);
+ if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data)) {
+ OPENSSL_free(ret);
+ return NULL;
+ }
return ret;
}