summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 21d6835b98e..cde564cade1 100644
--- a/lib/libssl/ssl_lib.c
+++ b/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;