diff options
author | 2015-03-27 12:29:54 +0000 | |
---|---|---|
committer | 2015-03-27 12:29:54 +0000 | |
commit | 4c5ec7da26a11a298d79cded54aa76d431fdda94 (patch) | |
tree | 59e19ccbcd28ea53aebc59248e7f35610a5d20e4 /lib/libssl/src/ssl/s3_srvr.c | |
parent | BUF_MEM_free() has its own explicit NULL check. (diff) | |
download | wireguard-openbsd-4c5ec7da26a11a298d79cded54aa76d431fdda94.tar.xz wireguard-openbsd-4c5ec7da26a11a298d79cded54aa76d431fdda94.zip |
Factor out the init_buf initialisation code, rather than duplicating it
in four different places.
ok doug@ guenther@
Diffstat (limited to 'lib/libssl/src/ssl/s3_srvr.c')
-rw-r--r-- | lib/libssl/src/ssl/s3_srvr.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/libssl/src/ssl/s3_srvr.c b/lib/libssl/src/ssl/s3_srvr.c index 0bff0204d96..ce48809f65b 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.100 2015/02/25 03:49:21 bcook Exp $ */ +/* $OpenBSD: s3_srvr.c,v 1.101 2015/03/27 12:29:54 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -265,21 +265,10 @@ 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; - } - s->init_buf = buf; + if (!ssl3_setup_init_buffer(s)) { + ret = -1; + goto end; } - if (!ssl3_setup_buffers(s)) { ret = -1; goto end; |