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>
This commit is contained in:
Matt Caswell 2016-04-29 11:27:09 +01:00
parent ed3eb5e0cc
commit 138388fe33

View file

@ -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;
}