diff options
author | Matt Caswell <matt@openssl.org> | 2016-04-29 11:27:09 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-04-29 16:47:41 +0100 |
commit | 138388fe33707529683e1a41b0fe47d60313e7c1 (patch) | |
tree | 031978cdfd03482687695771df6086ccfb95ded1 /crypto/bio/b_addr.c | |
parent | ed3eb5e0cca0ac88908e5d718ac0137d0150ddb3 (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.c | 3 |
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; } |