mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
Don't double free the write bio
When setting the read bio we free up any old existing one. However this can lead to a double free if the existing one is the same as the write bio. Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
7fb4c82035
commit
8e3854ac88
@ -1045,7 +1045,7 @@ void SSL_free(SSL *s)
|
||||
|
||||
void SSL_set_rbio(SSL *s, BIO *rbio)
|
||||
{
|
||||
if (s->rbio != rbio)
|
||||
if (s->rbio != rbio && s->rbio != s->wbio)
|
||||
BIO_free_all(s->rbio);
|
||||
s->rbio = rbio;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user