mirror of
https://github.com/openssl/openssl.git
synced 2025-04-06 20:20:50 +08:00
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)
This commit is contained in:
parent
19e277dd19
commit
dce910af3b
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user