diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-30 12:12:26 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-09 23:48:41 +0100 |
commit | 90945fa31a42dcf3beb90540c618e4d627c595ea (patch) | |
tree | e73870c253abf0c37ca618384e30a7937a996b55 /crypto/bn | |
parent | Standardise our style for checking malloc failures (diff) | |
download | openssl-90945fa31a42dcf3beb90540c618e4d627c595ea.tar.xz openssl-90945fa31a42dcf3beb90540c618e4d627c595ea.zip |
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/bn')
-rw-r--r-- | crypto/bn/bn_ctx.c | 2 | ||||
-rw-r--r-- | crypto/bn/bn_intern.c | 2 | ||||
-rw-r--r-- | crypto/bn/bn_lib.c | 2 | ||||
-rw-r--r-- | crypto/bn/bn_mont.c | 2 | ||||
-rw-r--r-- | crypto/bn/bn_rand.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/crypto/bn/bn_ctx.c b/crypto/bn/bn_ctx.c index 756d404c13..19ff68e1eb 100644 --- a/crypto/bn/bn_ctx.c +++ b/crypto/bn/bn_ctx.c @@ -204,7 +204,7 @@ BN_CTX *BN_CTX_secure_new(void) { BN_CTX *ret = BN_CTX_new(); - if (ret) + if (ret != NULL) ret->flags = BN_FLG_SECURE; return ret; } diff --git a/crypto/bn/bn_intern.c b/crypto/bn/bn_intern.c index 0b222517d4..abc8fc45a1 100644 --- a/crypto/bn/bn_intern.c +++ b/crypto/bn/bn_intern.c @@ -74,7 +74,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len) if (BN_is_zero(scalar)) { r = OPENSSL_malloc(1); - if (!r) { + if (r == NULL) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_MALLOC_FAILURE); goto err; } diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index 3b07d7d28c..2042920d35 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -287,7 +287,7 @@ BIGNUM *BN_new(void) BIGNUM *BN_secure_new(void) { BIGNUM *ret = BN_new(); - if (ret) + if (ret != NULL) ret->flags |= BN_FLG_SECURE; return (ret); } diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index d4d817a74f..bda2157aa5 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -517,7 +517,7 @@ BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, * (the losers throw away the work they've done). */ ret = BN_MONT_CTX_new(); - if (!ret) + if (ret == NULL) return NULL; if (!BN_MONT_CTX_set(ret, mod, ctx)) { BN_MONT_CTX_free(ret); diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c index 2764c8a307..66a175c32a 100644 --- a/crypto/bn/bn_rand.c +++ b/crypto/bn/bn_rand.c @@ -315,7 +315,7 @@ int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range, int ret = 0; k_bytes = OPENSSL_malloc(num_k_bytes); - if (!k_bytes) + if (k_bytes == NULL) goto err; /* We copy |priv| into a local buffer to avoid exposing its length. */ |