From: Matt Caswell Date: Thu, 21 Jul 2016 09:28:24 +0000 (+0100) Subject: Don't double free the write bio X-Git-Tag: OpenSSL_1_1_0-pre6~63 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8e3854ac88836df0ba862b1aba851dcd963c4ad2;p=oweals%2Fopenssl.git 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 --- 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; }