aboutsummaryrefslogtreecommitdiff
path: root/crypto/bio
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/bio
parenta71edf3ba275b946224b5bcded0a8ecfce1855c0 (diff)
downloadopenssl-90945fa31a42dcf3beb90540c618e4d627c595ea.zip
openssl-90945fa31a42dcf3beb90540c618e4d627c595ea.tar.gz
openssl-90945fa31a42dcf3beb90540c618e4d627c595ea.tar.bz2
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/bio')
-rw-r--r--crypto/bio/b_print.c2
-rw-r--r--crypto/bio/bss_dgram.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c
index f49ebee4..f82b078 100644
--- a/crypto/bio/b_print.c
+++ b/crypto/bio/b_print.c
@@ -711,7 +711,7 @@ doapr_outch(char **sbuffer,
*maxlen += 1024;
if (*buffer == NULL) {
*buffer = OPENSSL_malloc(*maxlen);
- if (!*buffer) {
+ if (*buffer == NULL) {
/* Panic! Can't really do anything sensible. Just return */
return;
}
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index 9c6af4b..0975856 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -997,7 +997,7 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag)
*/
sockopt_len = (socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
authchunks = OPENSSL_zalloc(sockopt_len);
- if (!authchunks) {
+ if (authchunks == NULL) {
BIO_vfree(bio);
return (NULL);
}
@@ -1334,7 +1334,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl)
optlen =
(socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
authchunks = OPENSSL_malloc(optlen);
- if (!authchunks) {
+ if (authchunks == NULL) {
BIOerr(BIO_F_DGRAM_SCTP_READ, ERR_R_MALLOC_FAILURE);
return -1;
}