summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c7
1 files changed, 2 insertions, 5 deletions
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)
270 return (NULL); 270 return (NULL);
271 } 271 }
272 272
273 s = (SSL *)malloc(sizeof(SSL)); 273 s = calloc(1, sizeof(SSL));
274 if (s == NULL) 274 if (s == NULL)
275 goto err; 275 goto err;
276 memset(s, 0, sizeof(SSL));
277 276
278#ifndef OPENSSL_NO_KRB5 277#ifndef OPENSSL_NO_KRB5
279 s->kssl_ctx = kssl_ctx_new(); 278 s->kssl_ctx = kssl_ctx_new();
@@ -1685,12 +1684,10 @@ SSL_CTX_new(const SSL_METHOD *meth)
1685 SSLerr(SSL_F_SSL_CTX_NEW, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS); 1684 SSLerr(SSL_F_SSL_CTX_NEW, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS);
1686 goto err; 1685 goto err;
1687 } 1686 }
1688 ret = (SSL_CTX *)malloc(sizeof(SSL_CTX)); 1687 ret = calloc(1, sizeof(SSL_CTX));
1689 if (ret == NULL) 1688 if (ret == NULL)
1690 goto err; 1689 goto err;
1691 1690
1692 memset(ret, 0, sizeof(SSL_CTX));
1693
1694 ret->method = meth; 1691 ret->method = meth;
1695 1692
1696 ret->cert_store = NULL; 1693 ret->cert_store = NULL;