From 852fcec6fe7cfa5d7c83e2f494208588dd4b4031 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Mon, 21 Apr 2014 16:34:43 +0000 Subject: more malloc/realloc/calloc cleanups; ok beck kettenis --- src/lib/libssl/ssl_lib.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 21d6835b98..cde564cade 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -270,10 +270,9 @@ SSL_new(SSL_CTX *ctx) return (NULL); } - s = (SSL *)malloc(sizeof(SSL)); + s = calloc(1, sizeof(SSL)); if (s == NULL) goto err; - memset(s, 0, sizeof(SSL)); #ifndef OPENSSL_NO_KRB5 s->kssl_ctx = kssl_ctx_new(); @@ -1685,12 +1684,10 @@ SSL_CTX_new(const SSL_METHOD *meth) SSLerr(SSL_F_SSL_CTX_NEW, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS); goto err; } - ret = (SSL_CTX *)malloc(sizeof(SSL_CTX)); + ret = calloc(1, sizeof(SSL_CTX)); if (ret == NULL) goto err; - memset(ret, 0, sizeof(SSL_CTX)); - ret->method = meth; ret->cert_store = NULL; -- cgit v1.2.3-55-g6feb