diff options
author | Rich Salz <rsalz@openssl.org> | 2018-03-27 22:25:08 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2018-03-27 22:25:08 +0200 |
commit | e6e9170d6e28038768895e1af18e3aad8093bf4b (patch) | |
tree | 62f594f0968ff8d6c27795377a102e4aab373b00 /crypto/bio | |
parent | o_time.c: use gmtime_s with MSVC (diff) | |
download | openssl-e6e9170d6e28038768895e1af18e3aad8093bf4b.tar.xz openssl-e6e9170d6e28038768895e1af18e3aad8093bf4b.zip |
Allow NULL for some _free routines.
Based on the description in https://github.com/openssl/openssl/pull/5757,
this re-implements the "allow NULL to be passed" behavior of a number of
xxx_free routines. I also fixed up some egregious formatting errors
that were nearby.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5761)
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bss_acpt.c | 2 | ||||
-rw-r--r-- | crypto/bio/bss_conn.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 0171c49607..64cc452891 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -101,6 +101,8 @@ static BIO_ACCEPT *BIO_ACCEPT_new(void) static void BIO_ACCEPT_free(BIO_ACCEPT *a) { + if (a == NULL) + return; OPENSSL_free(a->param_addr); OPENSSL_free(a->param_serv); BIO_ADDRINFO_free(a->addr_first); diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 0fad02fdd5..cc245ab07c 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -232,6 +232,8 @@ BIO_CONNECT *BIO_CONNECT_new(void) void BIO_CONNECT_free(BIO_CONNECT *a) { + if (a == NULL) + return; OPENSSL_free(a->param_hostname); OPENSSL_free(a->param_service); BIO_ADDRINFO_free(a->addr_first); |