diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-30 11:12:26 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-09 22:48:41 +0000 |
commit | 90945fa31a42dcf3beb90540c618e4d627c595ea (patch) | |
tree | e73870c253abf0c37ca618384e30a7937a996b55 /crypto/ec/ec_mult.c | |
parent | a71edf3ba275b946224b5bcded0a8ecfce1855c0 (diff) |
Continue standardising malloc style for libcrypto
Continuing from previous commit ensure our style is consistent for malloc
return checks.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'crypto/ec/ec_mult.c')
-rw-r--r-- | crypto/ec/ec_mult.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c index a3d9885dcf..7e29397cba 100644 --- a/crypto/ec/ec_mult.c +++ b/crypto/ec/ec_mult.c @@ -101,7 +101,7 @@ static EC_PRE_COMP *ec_pre_comp_new(const EC_GROUP *group) return NULL; ret = OPENSSL_zalloc(sizeof(*ret)); - if (!ret) { + if (ret == NULL) { ECerr(EC_F_EC_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE); return ret; } @@ -296,10 +296,10 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, val_sub = OPENSSL_malloc(totalnum * sizeof val_sub[0]); /* Ensure wNAF is initialised in case we end up going to err */ - if (wNAF) + if (wNAF != NULL) wNAF[0] = NULL; /* preliminary pivot */ - if (!wsize || !wNAF_len || !wNAF || !val_sub) { + if (wsize == NULL || wNAF_len == NULL || wNAF == NULL || val_sub == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); goto err; } @@ -657,7 +657,7 @@ int ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx) * and store */ points = OPENSSL_malloc(sizeof(*points) * (num + 1)); - if (!points) { + if (points == NULL) { ECerr(EC_F_EC_WNAF_PRECOMPUTE_MULT, ERR_R_MALLOC_FAILURE); goto err; } |