summaryrefslogtreecommitdiff
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2015-10-16 14:23:23 +0000
committerBob Beck <beck@cvs.openbsd.org>2015-10-16 14:23:23 +0000
commit894506ae112b419f00b353f9ff90a22ac043a8ca (patch)
tree1651b23ca8e7312dc156c701d67af08855d829ea /lib/libssl/ssl_lib.c
parent3fab58fcc8cf4ad05efad0ab07628a0d5f2dccb9 (diff)
Fix use of pointer value after BIO_free, and remove senseless NULL checks.
ok bcook@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 0b094e8db6b..6479f729e7f 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.113 2015/10/03 06:47:32 doug Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.114 2015/10/16 14:23:22 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -502,10 +502,10 @@ 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))
+
+ if (s->wbio != s->rbio)
BIO_free_all(s->wbio);
+ BIO_free_all(s->rbio);
if (s->init_buf != NULL)
BUF_MEM_free(s->init_buf);
@@ -571,10 +571,11 @@ SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio)
s->bbio->next_bio = NULL;
}
}
- if ((s->rbio != NULL) && (s->rbio != rbio))
- BIO_free_all(s->rbio);
- if ((s->wbio != NULL) && (s->wbio != wbio) && (s->rbio != s->wbio))
+
+ if ((s->wbio != wbio) && (s->rbio != s->wbio))
BIO_free_all(s->wbio);
+ if (s->rbio != rbio)
+ BIO_free_all(s->rbio);
s->rbio = rbio;
s->wbio = wbio;
}