summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2015-07-19 20:32:18 +0000
committerdoug <doug@openbsd.org>2015-07-19 20:32:18 +0000
commitdd39d9dd286e595263e46e2372bd90e9eab27ca5 (patch)
tree83767707059502d55d4e2f4e593a73051c28c503 /lib/libssl/src
parentTest octet counting and non transparent framing. (diff)
downloadwireguard-openbsd-dd39d9dd286e595263e46e2372bd90e9eab27ca5.tar.xz
wireguard-openbsd-dd39d9dd286e595263e46e2372bd90e9eab27ca5.zip
Allow *_free() functions in libssl to handle NULL input.
This mimics free()'s behavior which makes error handling simpler. ok bcook@ miod@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/ssl/d1_both.c4
-rw-r--r--lib/libssl/src/ssl/d1_lib.c5
-rw-r--r--lib/libssl/src/ssl/s3_enc.c5
-rw-r--r--lib/libssl/src/ssl/ssl_lib.c5
-rw-r--r--lib/libssl/src/ssl/t1_lib.c5
5 files changed, 19 insertions, 5 deletions
diff --git a/lib/libssl/src/ssl/d1_both.c b/lib/libssl/src/ssl/d1_both.c
index 5c93af8bd91..b479c61322e 100644
--- a/lib/libssl/src/ssl/d1_both.c
+++ b/lib/libssl/src/ssl/d1_both.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_both.c,v 1.33 2015/07/18 23:00:23 doug Exp $ */
+/* $OpenBSD: d1_both.c,v 1.34 2015/07/19 20:32:18 doug Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -209,6 +209,8 @@ dtls1_hm_fragment_new(unsigned long frag_len, int reassembly)
static void
dtls1_hm_fragment_free(hm_fragment *frag)
{
+ if (frag == NULL)
+ return;
if (frag->msg_header.is_ccs) {
EVP_CIPHER_CTX_free(
diff --git a/lib/libssl/src/ssl/d1_lib.c b/lib/libssl/src/ssl/d1_lib.c
index dd789ccc702..b269efe4690 100644
--- a/lib/libssl/src/ssl/d1_lib.c
+++ b/lib/libssl/src/ssl/d1_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_lib.c,v 1.28 2015/03/19 14:00:22 tedu Exp $ */
+/* $OpenBSD: d1_lib.c,v 1.29 2015/07/19 20:32:18 doug Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -190,6 +190,9 @@ dtls1_clear_queues(SSL *s)
void
dtls1_free(SSL *s)
{
+ if (s == NULL)
+ return;
+
ssl3_free(s);
dtls1_clear_queues(s);
diff --git a/lib/libssl/src/ssl/s3_enc.c b/lib/libssl/src/ssl/s3_enc.c
index c30b7519fbf..bfa719df5fe 100644
--- a/lib/libssl/src/ssl/s3_enc.c
+++ b/lib/libssl/src/ssl/s3_enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_enc.c,v 1.60 2015/06/17 14:27:56 jsing Exp $ */
+/* $OpenBSD: s3_enc.c,v 1.61 2015/07/19 20:32:18 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -491,6 +491,9 @@ ssl3_free_digest_list(SSL *s)
{
int i;
+ if (s == NULL)
+ return;
+
if (s->s3->handshake_dgst == NULL)
return;
for (i = 0; i < SSL_MAX_DIGEST; i++) {
diff --git a/lib/libssl/src/ssl/ssl_lib.c b/lib/libssl/src/ssl/ssl_lib.c
index 1dd518d0b83..629ad035542 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.104 2015/06/28 00:08:27 doug Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.105 2015/07/19 20:32:18 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -2825,6 +2825,9 @@ ssl_init_wbio_buffer(SSL *s, int push)
void
ssl_free_wbio_buffer(SSL *s)
{
+ if (s == NULL)
+ return;
+
if (s->bbio == NULL)
return;
diff --git a/lib/libssl/src/ssl/t1_lib.c b/lib/libssl/src/ssl/t1_lib.c
index b0f0de3bd8b..70823bf8e71 100644
--- a/lib/libssl/src/ssl/t1_lib.c
+++ b/lib/libssl/src/ssl/t1_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t1_lib.c,v 1.79 2015/07/17 15:50:37 doug Exp $ */
+/* $OpenBSD: t1_lib.c,v 1.80 2015/07/19 20:32:18 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -198,6 +198,9 @@ tls1_new(SSL *s)
void
tls1_free(SSL *s)
{
+ if (s == NULL)
+ return;
+
free(s->tlsext_session_ticket);
ssl3_free(s);
}