summaryrefslogtreecommitdiffstats
path: root/crypto/modes/ocb128.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-10-30 11:12:26 +0000
committerMatt Caswell <matt@openssl.org>2015-11-09 22:48:41 +0000
commit90945fa31a42dcf3beb90540c618e4d627c595ea (patch)
treee73870c253abf0c37ca618384e30a7937a996b55 /crypto/modes/ocb128.c
parenta71edf3ba275b946224b5bcded0a8ecfce1855c0 (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/modes/ocb128.c')
-rw-r--r--crypto/modes/ocb128.c6
1 files changed, 3 insertions, 3 deletions
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);
}