summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-07-21 10:28:24 +0100
committerMatt Caswell <matt@openssl.org>2016-07-29 14:09:57 +0100
commit8e3854ac88836df0ba862b1aba851dcd963c4ad2 (patch)
tree89cb7904a4ad5c9b923cfa664402aec2ac33481a
parent7fb4c82035d05ca8735303caa9941aeead165b78 (diff)
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>
-rw-r--r--ssl/ssl_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 4288c6fbbc..c49fc5c704 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -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;
}