2
0
mirror of https://github.com/openssl/openssl.git synced 2025-03-31 20:10:45 +08:00

bio_ssl.c: Do not call SSL_shutdown if not inited

Fixes 

If free is called for an SSL BIO that is in initialization phase,
the `SSL_shutdown` call is omitted.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24705)
This commit is contained in:
erbsland-dev 2024-06-22 09:14:25 +02:00 committed by Tomas Mraz
parent 42a8ef844e
commit 57b83edc46

@ -79,7 +79,7 @@ static int ssl_free(BIO *a)
return 0;
bs = BIO_get_data(a);
if (BIO_get_shutdown(a)) {
if (bs->ssl != NULL)
if (bs->ssl != NULL && !SSL_in_init(bs->ssl))
SSL_shutdown(bs->ssl);
if (BIO_get_init(a))
SSL_free(bs->ssl);