summaryrefslogtreecommitdiff
path: root/lib/libssl
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
commit0db83029b976d0edce815fc30a7254a07219d2f3 (patch)
treeb9ee19996c18e939767e7a8ac6f878c91d866cc1 /lib/libssl
parentcbb1042b55755d8a54ff1299af6b295a9bfe752f (diff)
Fix use of pointer value after BIO_free, and remove senseless NULL checks.
ok bcook@
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/src/ssl/ssl_lib.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libssl/src/ssl/ssl_lib.c b/lib/libssl/src/ssl/ssl_lib.c
index 0b094e8db6b..6479f729e7f 100644
--- a/lib/libssl/src/ssl/ssl_lib.c
+++ b/lib/libssl/src/ssl/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;
}