diff options
Diffstat (limited to 'crypto/modes')
-rw-r--r-- | crypto/modes/gcm128.c | 2 | ||||
-rw-r--r-- | crypto/modes/ocb128.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crypto/modes/gcm128.c b/crypto/modes/gcm128.c index f28e07ceb0..0615224dd0 100644 --- a/crypto/modes/gcm128.c +++ b/crypto/modes/gcm128.c @@ -1701,7 +1701,7 @@ GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block) { GCM128_CONTEXT *ret; - if ((ret = OPENSSL_malloc(sizeof(*ret)))) + if ((ret = OPENSSL_malloc(sizeof(*ret))) != NULL) CRYPTO_gcm128_init(ret, key, block); return ret; diff --git a/crypto/modes/ocb128.c b/crypto/modes/ocb128.c index ed484606e5..2685652d3f 100644 --- a/crypto/modes/ocb128.c +++ b/crypto/modes/ocb128.c @@ -210,7 +210,7 @@ OCB128_CONTEXT *CRYPTO_ocb128_new(void *keyenc, void *keydec, OCB128_CONTEXT *octx; int ret; - if ((octx = OPENSSL_malloc(sizeof(*octx)))) { + if ((octx = OPENSSL_malloc(sizeof(*octx))) != NULL) { ret = CRYPTO_ocb128_init(octx, keyenc, keydec, encrypt, decrypt); if (ret) return octx; @@ -230,7 +230,7 @@ int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec, ctx->l_index = 0; ctx->max_l_index = 1; ctx->l = OPENSSL_malloc(ctx->max_l_index * 16); - if (!ctx->l) + if (ctx->l == NULL) return 0; /* @@ -268,7 +268,7 @@ int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src, dest->keydec = keydec; if (src->l) { dest->l = OPENSSL_malloc(src->max_l_index * 16); - if (!dest->l) + if (dest->l == NULL) return 0; memcpy(dest->l, src->l, (src->l_index + 1) * 16); } |