summaryrefslogtreecommitdiff
path: root/lib/libssl/s3_lib.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2017-01-22 00:09:14 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2017-01-22 00:09:14 +0000
commit254640e548721e6d359601f09fb965fbd331dff8 (patch)
treeec8955c4032fc5a2dec24227c05cf6941c573cf6 /lib/libssl/s3_lib.c
parent817b0ccc5bbd4532cffe70f2fcdfff3015d8fe72 (diff)
Clean up ssl3_new() - in particular, we do not need to zero fields that
are within a struct that was just allocated via calloc. ok beck@
Diffstat (limited to 'lib/libssl/s3_lib.c')
-rw-r--r--lib/libssl/s3_lib.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c
index 18c405d13a2..0dda987d4c1 100644
--- a/lib/libssl/s3_lib.c
+++ b/lib/libssl/s3_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_lib.c,v 1.116 2017/01/22 00:03:18 jsing Exp $ */
+/* $OpenBSD: s3_lib.c,v 1.117 2017/01/22 00:09:13 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1809,19 +1809,12 @@ ssl3_handshake_write(SSL *s)
int
ssl3_new(SSL *s)
{
- SSL3_STATE *s3;
-
- if ((s3 = calloc(1, sizeof *s3)) == NULL)
- goto err;
- memset(s3->rrec.seq_num, 0, sizeof(s3->rrec.seq_num));
- memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num));
-
- s->s3 = s3;
+ if ((s->s3 = calloc(1, sizeof(*s->s3))) == NULL)
+ return (0);
s->method->ssl_clear(s);
+
return (1);
-err:
- return (0);
}
void