diff options
Diffstat (limited to 'lib/vtls')
-rw-r--r-- | lib/vtls/polarssl.c | 4 | ||||
-rw-r--r-- | lib/vtls/schannel.c | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/vtls/polarssl.c b/lib/vtls/polarssl.c index d36cc70ee..811cdc2fb 100644 --- a/lib/vtls/polarssl.c +++ b/lib/vtls/polarssl.c @@ -620,12 +620,10 @@ polarssl_connect_step3(struct connectdata *conn, ssl_session *our_ssl_sessionid; void *old_ssl_sessionid = NULL; - our_ssl_sessionid = malloc(sizeof(ssl_session)); + our_ssl_sessionid = calloc(1, sizeof(ssl_session)); if(!our_ssl_sessionid) return CURLE_OUT_OF_MEMORY; - memset(our_ssl_sessionid, 0, sizeof(ssl_session)); - ret = ssl_get_session(&BACKEND->ssl, our_ssl_sessionid); if(ret) { failf(data, "ssl_get_session returned -0x%x", -ret); diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 76392a1fd..11fc401f9 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -363,12 +363,11 @@ schannel_connect_step1(struct connectdata *conn, int sockindex) /* allocate memory for the re-usable credential handle */ BACKEND->cred = (struct curl_schannel_cred *) - malloc(sizeof(struct curl_schannel_cred)); + calloc(1, sizeof(struct curl_schannel_cred)); if(!BACKEND->cred) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; } - memset(BACKEND->cred, 0, sizeof(struct curl_schannel_cred)); BACKEND->cred->refcount = 1; /* https://msdn.microsoft.com/en-us/library/windows/desktop/aa374716.aspx @@ -466,12 +465,11 @@ schannel_connect_step1(struct connectdata *conn, int sockindex) /* allocate memory for the security context handle */ BACKEND->ctxt = (struct curl_schannel_ctxt *) - malloc(sizeof(struct curl_schannel_ctxt)); + calloc(1, sizeof(struct curl_schannel_ctxt)); if(!BACKEND->ctxt) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; } - memset(BACKEND->ctxt, 0, sizeof(struct curl_schannel_ctxt)); host_name = Curl_convert_UTF8_to_tchar(hostname); if(!host_name) |