summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-04-21 16:34:43 +0000
committerderaadt <deraadt@openbsd.org>2014-04-21 16:34:43 +0000
commit7c5c1828b5ea9a4d3c2f261136ee2d59ee5e9cfe (patch)
tree1efb16a0ba246f5bf01f2ad06c49d2a0167abb83 /lib/libssl/ssl_lib.c
parentKNF. (diff)
downloadwireguard-openbsd-7c5c1828b5ea9a4d3c2f261136ee2d59ee5e9cfe.tar.xz
wireguard-openbsd-7c5c1828b5ea9a4d3c2f261136ee2d59ee5e9cfe.zip
more malloc/realloc/calloc cleanups; ok beck kettenis
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;