summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-09-27 14:22:40 +0200
committerDr. David von Oheimb <dev@ddvo.net>2021-12-03 11:55:01 +0100
commitf623a68efad0b00c698b3e10963f51971f55ffba (patch)
treeee1e016dde603c6be0c4d8804e784b30514102e2 /ssl
parent76eb12aa278cb30a495bcee3fdc176d0a6c35052 (diff)
Fix ssl_free() and thus BIO_free() to respect BIO_NOCLOSE
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17135)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/bio_ssl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c
index c4239345b6..67097d5cca 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);