summaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_addr.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-04-29 11:27:09 +0100
committerMatt Caswell <matt@openssl.org>2016-04-29 16:47:41 +0100
commit138388fe33707529683e1a41b0fe47d60313e7c1 (patch)
tree031978cdfd03482687695771df6086ccfb95ded1 /crypto/bio/b_addr.c
parented3eb5e0cca0ac88908e5d718ac0137d0150ddb3 (diff)
Check for failed malloc in BIO_ADDR_new
BIO_ADDR_new() calls OPENSSL_zalloc() which can fail - but the return value is not checked. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/bio/b_addr.c')
-rw-r--r--crypto/bio/b_addr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index bfc745b769..86c6c7eca8 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -83,6 +83,9 @@ BIO_ADDR *BIO_ADDR_new(void)
{
BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret));
+ if (ret == NULL)
+ return NULL;
+
ret->sa.sa_family = AF_UNSPEC;
return ret;
}