diff options
author | 2014-06-30 14:13:27 +0000 | |
---|---|---|
committer | 2014-06-30 14:13:27 +0000 | |
commit | 9e14334caba3d08abf1327aff7ccaadc392b180b (patch) | |
tree | 8ab00e55308991e2b1a5e36d74a6385493f34f92 | |
parent | Merge two loops in collapse_redirspec into one (diff) | |
download | wireguard-openbsd-9e14334caba3d08abf1327aff7ccaadc392b180b.tar.xz wireguard-openbsd-9e14334caba3d08abf1327aff7ccaadc392b180b.zip |
fix the identical leak in three different files.
reported by Brent Cook, original diff by logan
-rw-r--r-- | lib/libssl/d1_srvr.c | 5 | ||||
-rw-r--r-- | lib/libssl/s23_srvr.c | 5 | ||||
-rw-r--r-- | lib/libssl/s3_srvr.c | 5 | ||||
-rw-r--r-- | lib/libssl/src/ssl/d1_srvr.c | 5 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s23_srvr.c | 5 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s3_srvr.c | 5 |
6 files changed, 18 insertions, 12 deletions
diff --git a/lib/libssl/d1_srvr.c b/lib/libssl/d1_srvr.c index 1c4b2e9f6da..d4d564a6883 100644 --- a/lib/libssl/d1_srvr.c +++ b/lib/libssl/d1_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srvr.c,v 1.26 2014/06/12 15:49:31 deraadt Exp $ */ +/* $OpenBSD: d1_srvr.c,v 1.27 2014/06/30 14:13:27 tedu Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -176,7 +176,6 @@ dtls1_get_server_method(int ver) int dtls1_accept(SSL *s) { - BUF_MEM *buf; void (*cb)(const SSL *ssl, int type, int val) = NULL; unsigned long alg_k; int ret = -1; @@ -241,11 +240,13 @@ dtls1_accept(SSL *s) s->type = SSL_ST_ACCEPT; if (s->init_buf == NULL) { + BUF_MEM *buf; if ((buf = BUF_MEM_new()) == NULL) { ret = -1; goto end; } if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret = -1; goto end; } diff --git a/lib/libssl/s23_srvr.c b/lib/libssl/s23_srvr.c index 52dc261814c..cd1a5174a70 100644 --- a/lib/libssl/s23_srvr.c +++ b/lib/libssl/s23_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s23_srvr.c,v 1.28 2014/06/12 15:49:31 deraadt Exp $ */ +/* $OpenBSD: s23_srvr.c,v 1.29 2014/06/30 14:13:27 tedu Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -174,7 +174,6 @@ ssl23_get_server_method(int ver) int ssl23_accept(SSL *s) { - BUF_MEM *buf; void (*cb)(const SSL *ssl, int type, int val) = NULL; int ret = -1; int new_state, state; @@ -208,11 +207,13 @@ ssl23_accept(SSL *s) s->type = SSL_ST_ACCEPT; if (s->init_buf == NULL) { + BUF_MEM *buf; if ((buf = BUF_MEM_new()) == NULL) { ret = -1; goto end; } if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret = -1; goto end; } diff --git a/lib/libssl/s3_srvr.c b/lib/libssl/s3_srvr.c index 161534295fa..a3387040a93 100644 --- a/lib/libssl/s3_srvr.c +++ b/lib/libssl/s3_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_srvr.c,v 1.66 2014/06/19 21:29:51 tedu Exp $ */ +/* $OpenBSD: s3_srvr.c,v 1.67 2014/06/30 14:13:27 tedu Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -214,7 +214,6 @@ ssl3_get_server_method(int ver) int ssl3_accept(SSL *s) { - BUF_MEM *buf; unsigned long alg_k; void (*cb)(const SSL *ssl, int type, int val) = NULL; int ret = -1; @@ -264,12 +263,14 @@ ssl3_accept(SSL *s) s->type = SSL_ST_ACCEPT; if (s->init_buf == NULL) { + BUF_MEM *buf; if ((buf = BUF_MEM_new()) == NULL) { ret = -1; goto end; } if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret = -1; goto end; } diff --git a/lib/libssl/src/ssl/d1_srvr.c b/lib/libssl/src/ssl/d1_srvr.c index 1c4b2e9f6da..d4d564a6883 100644 --- a/lib/libssl/src/ssl/d1_srvr.c +++ b/lib/libssl/src/ssl/d1_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srvr.c,v 1.26 2014/06/12 15:49:31 deraadt Exp $ */ +/* $OpenBSD: d1_srvr.c,v 1.27 2014/06/30 14:13:27 tedu Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -176,7 +176,6 @@ dtls1_get_server_method(int ver) int dtls1_accept(SSL *s) { - BUF_MEM *buf; void (*cb)(const SSL *ssl, int type, int val) = NULL; unsigned long alg_k; int ret = -1; @@ -241,11 +240,13 @@ dtls1_accept(SSL *s) s->type = SSL_ST_ACCEPT; if (s->init_buf == NULL) { + BUF_MEM *buf; if ((buf = BUF_MEM_new()) == NULL) { ret = -1; goto end; } if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret = -1; goto end; } diff --git a/lib/libssl/src/ssl/s23_srvr.c b/lib/libssl/src/ssl/s23_srvr.c index 52dc261814c..cd1a5174a70 100644 --- a/lib/libssl/src/ssl/s23_srvr.c +++ b/lib/libssl/src/ssl/s23_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s23_srvr.c,v 1.28 2014/06/12 15:49:31 deraadt Exp $ */ +/* $OpenBSD: s23_srvr.c,v 1.29 2014/06/30 14:13:27 tedu Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -174,7 +174,6 @@ ssl23_get_server_method(int ver) int ssl23_accept(SSL *s) { - BUF_MEM *buf; void (*cb)(const SSL *ssl, int type, int val) = NULL; int ret = -1; int new_state, state; @@ -208,11 +207,13 @@ ssl23_accept(SSL *s) s->type = SSL_ST_ACCEPT; if (s->init_buf == NULL) { + BUF_MEM *buf; if ((buf = BUF_MEM_new()) == NULL) { ret = -1; goto end; } if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret = -1; goto end; } diff --git a/lib/libssl/src/ssl/s3_srvr.c b/lib/libssl/src/ssl/s3_srvr.c index 161534295fa..a3387040a93 100644 --- a/lib/libssl/src/ssl/s3_srvr.c +++ b/lib/libssl/src/ssl/s3_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_srvr.c,v 1.66 2014/06/19 21:29:51 tedu Exp $ */ +/* $OpenBSD: s3_srvr.c,v 1.67 2014/06/30 14:13:27 tedu Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -214,7 +214,6 @@ ssl3_get_server_method(int ver) int ssl3_accept(SSL *s) { - BUF_MEM *buf; unsigned long alg_k; void (*cb)(const SSL *ssl, int type, int val) = NULL; int ret = -1; @@ -264,12 +263,14 @@ ssl3_accept(SSL *s) s->type = SSL_ST_ACCEPT; if (s->init_buf == NULL) { + BUF_MEM *buf; if ((buf = BUF_MEM_new()) == NULL) { ret = -1; goto end; } if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret = -1; goto end; } |