free NULL cleanup

This commit handles BIO_ACCEPT_free BIO_CB_FREE BIO_CONNECT_free
BIO_free BIO_free_all BIO_vfree

Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
Rich Salz
2015-03-25 11:31:18 -04:00
parent 2011b169fa
commit ca3a82c3b3
76 changed files with 201 additions and 389 deletions

View File

@@ -543,9 +543,8 @@ void SSL_free(SSL *s)
BIO_free(s->bbio);
s->bbio = NULL;
}
if (s->rbio != NULL)
BIO_free_all(s->rbio);
if ((s->wbio != NULL) && (s->wbio != s->rbio))
BIO_free_all(s->rbio);
if (s->wbio != s->rbio)
BIO_free_all(s->wbio);
if (s->init_buf != NULL)
@@ -621,7 +620,7 @@ void SSL_free(SSL *s)
void SSL_set_rbio(SSL *s, BIO *rbio)
{
if ((s->rbio != NULL) && (s->rbio != rbio))
if (s->rbio != rbio)
BIO_free_all(s->rbio);
s->rbio = rbio;
}
@@ -637,7 +636,7 @@ void SSL_set_wbio(SSL *s, BIO *wbio)
s->bbio->next_bio = NULL;
}
}
if ((s->wbio != NULL) && (s->wbio != wbio) && (s->rbio != s->wbio))
if (s->wbio != wbio && s->rbio != s->wbio)
BIO_free_all(s->wbio);
s->wbio = wbio;
}