diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-30 11:22:31 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-09 22:48:41 +0000 |
commit | 55646005a9ce3c85e394c6afae5f6ed6045494c6 (patch) | |
tree | a652c0090a3e7ea0889e56b9e8dbb99db5503665 /engines/e_chil.c | |
parent | 96487cddd408e247819c4f122bd86e53ae4bd6c0 (diff) |
Continue malloc standardisation in engines
Continuing from previous work standardise use of malloc in the engine code.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'engines/e_chil.c')
-rw-r--r-- | engines/e_chil.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/e_chil.c b/engines/e_chil.c index 54c6b913c1..8696c9ac2c 100644 --- a/engines/e_chil.c +++ b/engines/e_chil.c @@ -406,7 +406,7 @@ static int bind_helper(ENGINE *e) static ENGINE *engine_chil(void) { ENGINE *ret = ENGINE_new(); - if (!ret) + if (ret == NULL) return NULL; if (!bind_helper(ret)) { ENGINE_free(ret); @@ -780,7 +780,7 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, } # ifndef OPENSSL_NO_RSA hptr = OPENSSL_malloc(sizeof(*hptr)); - if (!hptr) { + if (hptr == NULL) { HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE); goto err; } @@ -827,10 +827,14 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, bn_fix_top(rtmp->n); res = EVP_PKEY_new(); + if (res == NULL) { + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, HWCRHK_R_CHIL_ERROR); + goto err; + } EVP_PKEY_assign_RSA(res, rtmp); # endif - if (!res) + if (res == NULL) HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, HWCRHK_R_PRIVATE_KEY_ALGORITHMS_DISABLED); |