aboutsummaryrefslogtreecommitdiff
path: root/ssl/s3_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-10-30 10:05:53 +0000
committerMatt Caswell <matt@openssl.org>2015-11-09 22:48:41 +0000
commita71edf3ba275b946224b5bcded0a8ecfce1855c0 (patch)
tree85257ad90882fc4d8d8f73cd91a03b7cc476b9d2 /ssl/s3_lib.c
parent3457e7a087a643cb65d67d9d72ec5983a02f5dfe (diff)
downloadopenssl-a71edf3ba275b946224b5bcded0a8ecfce1855c0.zip
openssl-a71edf3ba275b946224b5bcded0a8ecfce1855c0.tar.gz
openssl-a71edf3ba275b946224b5bcded0a8ecfce1855c0.tar.bz2
Standardise our style for checking malloc failures
if we have a malloc |x = OPENSSL_malloc(...)| sometimes we check |x| for NULL and sometimes we treat it as a boolean |if(!x) ...|. Standardise the approach in libssl. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r--ssl/s3_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 1c7e7a2..8b12761 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -4311,7 +4311,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
return 0;
#endif
ptmp = EVP_PKEY_new();
- if (!ptmp)
+ if (ptmp == NULL)
return 0;
#ifndef OPENSSL_NO_RSA
else if (s->s3->peer_rsa_tmp)
@@ -4999,7 +4999,7 @@ static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len)
if (len > 0xff)
return 0;
c->ctypes = OPENSSL_malloc(len);
- if (!c->ctypes)
+ if (c->ctypes == NULL)
return 0;
memcpy(c->ctypes, p, len);
c->ctype_num = len;