From bcd4033a22e1bf44686805b7d0fd9c2560c44eb4 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 22 Jan 2017 00:09:13 +0000 Subject: 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@ --- src/lib/libssl/s3_lib.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src') 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 @@ -/* $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 -- cgit v1.2.3-55-g6feb