diff options
author | tedu <> | 2014-06-30 14:13:27 +0000 |
---|---|---|
committer | tedu <> | 2014-06-30 14:13:27 +0000 |
commit | 9212388050af9e43bf2dc3b5be5f0e702bdb4587 (patch) | |
tree | 2ce716281af05057dc7170444b70c99555f00a60 /src/lib/libssl/d1_srvr.c | |
parent | abffb498f545f38a49bd1a499f2ba762720f2df3 (diff) | |
download | openbsd-9212388050af9e43bf2dc3b5be5f0e702bdb4587.tar.gz openbsd-9212388050af9e43bf2dc3b5be5f0e702bdb4587.tar.bz2 openbsd-9212388050af9e43bf2dc3b5be5f0e702bdb4587.zip |
fix the identical leak in three different files.
reported by Brent Cook, original diff by logan
Diffstat (limited to 'src/lib/libssl/d1_srvr.c')
-rw-r--r-- | src/lib/libssl/d1_srvr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index 1c4b2e9f6d..d4d564a688 100644 --- a/src/lib/libssl/d1_srvr.c +++ b/src/lib/libssl/d1_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_srvr.c,v 1.26 2014/06/12 15:49:31 deraadt Exp $ */ | 1 | /* $OpenBSD: d1_srvr.c,v 1.27 2014/06/30 14:13:27 tedu Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -176,7 +176,6 @@ dtls1_get_server_method(int ver) | |||
176 | int | 176 | int |
177 | dtls1_accept(SSL *s) | 177 | dtls1_accept(SSL *s) |
178 | { | 178 | { |
179 | BUF_MEM *buf; | ||
180 | void (*cb)(const SSL *ssl, int type, int val) = NULL; | 179 | void (*cb)(const SSL *ssl, int type, int val) = NULL; |
181 | unsigned long alg_k; | 180 | unsigned long alg_k; |
182 | int ret = -1; | 181 | int ret = -1; |
@@ -241,11 +240,13 @@ dtls1_accept(SSL *s) | |||
241 | s->type = SSL_ST_ACCEPT; | 240 | s->type = SSL_ST_ACCEPT; |
242 | 241 | ||
243 | if (s->init_buf == NULL) { | 242 | if (s->init_buf == NULL) { |
243 | BUF_MEM *buf; | ||
244 | if ((buf = BUF_MEM_new()) == NULL) { | 244 | if ((buf = BUF_MEM_new()) == NULL) { |
245 | ret = -1; | 245 | ret = -1; |
246 | goto end; | 246 | goto end; |
247 | } | 247 | } |
248 | if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { | 248 | if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) { |
249 | BUF_MEM_free(buf); | ||
249 | ret = -1; | 250 | ret = -1; |
250 | goto end; | 251 | goto end; |
251 | } | 252 | } |