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/s3_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/s3_srvr.c')
-rw-r--r-- | src/lib/libssl/s3_srvr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c index 161534295f..a3387040a9 100644 --- a/src/lib/libssl/s3_srvr.c +++ b/src/lib/libssl/s3_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s3_srvr.c,v 1.66 2014/06/19 21:29:51 tedu Exp $ */ | 1 | /* $OpenBSD: s3_srvr.c,v 1.67 2014/06/30 14:13:27 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -214,7 +214,6 @@ ssl3_get_server_method(int ver) | |||
214 | int | 214 | int |
215 | ssl3_accept(SSL *s) | 215 | ssl3_accept(SSL *s) |
216 | { | 216 | { |
217 | BUF_MEM *buf; | ||
218 | unsigned long alg_k; | 217 | unsigned long alg_k; |
219 | void (*cb)(const SSL *ssl, int type, int val) = NULL; | 218 | void (*cb)(const SSL *ssl, int type, int val) = NULL; |
220 | int ret = -1; | 219 | int ret = -1; |
@@ -264,12 +263,14 @@ ssl3_accept(SSL *s) | |||
264 | s->type = SSL_ST_ACCEPT; | 263 | s->type = SSL_ST_ACCEPT; |
265 | 264 | ||
266 | if (s->init_buf == NULL) { | 265 | if (s->init_buf == NULL) { |
266 | BUF_MEM *buf; | ||
267 | if ((buf = BUF_MEM_new()) == NULL) { | 267 | if ((buf = BUF_MEM_new()) == NULL) { |
268 | ret = -1; | 268 | ret = -1; |
269 | goto end; | 269 | goto end; |
270 | } | 270 | } |
271 | if (!BUF_MEM_grow(buf, | 271 | if (!BUF_MEM_grow(buf, |
272 | SSL3_RT_MAX_PLAIN_LENGTH)) { | 272 | SSL3_RT_MAX_PLAIN_LENGTH)) { |
273 | BUF_MEM_free(buf); | ||
273 | ret = -1; | 274 | ret = -1; |
274 | goto end; | 275 | goto end; |
275 | } | 276 | } |