From 94ebe6f457e7d877b4c8b3fd64c278bd6f8b3027 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@ --- lib/libssl/s3_lib.c | 15 ++++----------- 1 file 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 -- cgit v1.2.3-59-g8ed1b