diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-09-27 14:22:40 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-10-04 10:55:39 +0200 |
commit | dce910af3bb135bd6d7c5a4cc512043b3ad4acc1 (patch) | |
tree | deb14dd11b524bbb3f1b83ff142aebe0c7e433e0 | |
parent | 19e277dd19f2897f6a7b7eb236abe46655e575bf (diff) | |
download | openssl-dce910af3bb135bd6d7c5a4cc512043b3ad4acc1.tar.gz |
Fix ssl_free() and thus BIO_free() to respect BIO_NOCLOSE
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16688)
-rw-r--r-- | ssl/bio_ssl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index 43747785f0..401178f0c2 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -76,13 +76,12 @@ static int ssl_free(BIO *a) if (a == NULL) return 0; bs = BIO_get_data(a); - if (bs->ssl != NULL) - SSL_shutdown(bs->ssl); if (BIO_get_shutdown(a)) { + if (bs->ssl != NULL) + SSL_shutdown(bs->ssl); if (BIO_get_init(a)) SSL_free(bs->ssl); - /* Clear all flags */ - BIO_clear_flags(a, ~0); + BIO_clear_flags(a, ~0); /* Clear all flags */ BIO_set_init(a, 0); } OPENSSL_free(bs); |