diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2017-01-22 00:09:14 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2017-01-22 00:09:14 +0000 |
commit | 254640e548721e6d359601f09fb965fbd331dff8 (patch) | |
tree | ec8955c4032fc5a2dec24227c05cf6941c573cf6 | |
parent | 817b0ccc5bbd4532cffe70f2fcdfff3015d8fe72 (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@
-rw-r--r-- | lib/libssl/s3_lib.c | 15 |
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 |