summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2017-01-22 00:09:13 +0000
committerjsing <>2017-01-22 00:09:13 +0000
commitbcd4033a22e1bf44686805b7d0fd9c2560c44eb4 (patch)
treee2781eb74df637a0a1ccea14074440c4a7e4f724 /src
parentd24f4efcabb84e1f827bbc71d9f4dc8ee8ada0a4 (diff)
downloadopenbsd-bcd4033a22e1bf44686805b7d0fd9c2560c44eb4.tar.gz
openbsd-bcd4033a22e1bf44686805b7d0fd9c2560c44eb4.tar.bz2
openbsd-bcd4033a22e1bf44686805b7d0fd9c2560c44eb4.zip
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 'src')
-rw-r--r--src/lib/libssl/s3_lib.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c
index 18c405d13a..0dda987d4c 100644
--- a/src/lib/libssl/s3_lib.c
+++ b/src/lib/libssl/s3_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_lib.c,v 1.116 2017/01/22 00:03:18 jsing Exp $ */ 1/* $OpenBSD: s3_lib.c,v 1.117 2017/01/22 00:09:13 jsing 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 *
@@ -1809,19 +1809,12 @@ ssl3_handshake_write(SSL *s)
1809int 1809int
1810ssl3_new(SSL *s) 1810ssl3_new(SSL *s)
1811{ 1811{
1812 SSL3_STATE *s3; 1812 if ((s->s3 = calloc(1, sizeof(*s->s3))) == NULL)
1813 1813 return (0);
1814 if ((s3 = calloc(1, sizeof *s3)) == NULL)
1815 goto err;
1816 memset(s3->rrec.seq_num, 0, sizeof(s3->rrec.seq_num));
1817 memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num));
1818
1819 s->s3 = s3;
1820 1814
1821 s->method->ssl_clear(s); 1815 s->method->ssl_clear(s);
1816
1822 return (1); 1817 return (1);
1823err:
1824 return (0);
1825} 1818}
1826 1819
1827void 1820void