diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-04-30 16:23:33 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-06-01 13:14:49 +0100 |
commit | b2b361f6afb55c501bedef664c1fdc0d71a91d4b (patch) | |
tree | 2678410dc1fd78d2832316a9013104ca7698d23c /engines | |
parent | 57358a83a401ef469353b7ebdae0cf3b870a4d5e (diff) | |
download | openssl-b2b361f6afb55c501bedef664c1fdc0d71a91d4b.tar.gz |
Raise an Err when CRYPTO_THREAD_lock_new fails
Add missing error raise call, as it is done everywhere else.
and as CRYPTO_THREAD_lock_new don't do it internally.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r-- | engines/e_chil.c | 8 | ||||
-rw-r--r-- | engines/e_chil_err.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/engines/e_chil.c b/engines/e_chil.c index 0fb7aa49e8..c660aa97b7 100644 --- a/engines/e_chil.c +++ b/engines/e_chil.c @@ -309,8 +309,10 @@ static int bind_helper(ENGINE *e) # endif chil_lock = CRYPTO_THREAD_lock_new(); - if (chil_lock == NULL) + if (chil_lock == NULL) { + HWCRHKerr(HWCRHK_F_BIND_HELPER, ERR_R_MALLOC_FAILURE); return 0; + } if (!ENGINE_set_id(e, engine_hwcrhk_id) || !ENGINE_set_name(e, engine_hwcrhk_name) || @@ -1092,8 +1094,10 @@ static int hwcrhk_mutex_init(HWCryptoHook_Mutex * mt, HWCryptoHook_CallerContext * cactx) { mt->lock = CRYPTO_THREAD_lock_new(); - if (mt->lock == NULL) + if (mt->lock == NULL) { + HWCRHKerr(HWCRHK_F_HWCRHK_MUTEX_INIT, ERR_R_MALLOC_FAILURE); return 1; /* failure */ + } return 0; /* success */ } diff --git a/engines/e_chil_err.h b/engines/e_chil_err.h index 42fdd19f28..b0f0dd98d3 100644 --- a/engines/e_chil_err.h +++ b/engines/e_chil_err.h @@ -39,6 +39,8 @@ static void ERR_HWCRHK_error(int function, int reason, char *file, int line); # define HWCRHK_F_HWCRHK_MOD_EXP 107 # define HWCRHK_F_HWCRHK_RAND_BYTES 108 # define HWCRHK_F_HWCRHK_RSA_MOD_EXP 109 +# define HWCRHK_F_BIND_HELPER 110 +# define HWCRHK_F_HWCRHK_MUTEX_INIT 111 /* Reason codes. */ # define HWCRHK_R_ALREADY_LOADED 100 |