Skip to content
Snippets Groups Projects
Commit 274842ec authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

use calloc instead of malloc to save a call to memset()

parent c06da7c8
No related branches found
No related tags found
No related merge requests found
......@@ -507,13 +507,10 @@ CURLcode Curl_ssl_initsessions(struct SessionHandle *data, long amount)
return CURLE_OK;
session = (struct curl_ssl_session *)
malloc(amount * sizeof(struct curl_ssl_session));
calloc(sizeof(struct curl_ssl_session), amount);
if(!session)
return CURLE_OUT_OF_MEMORY;
/* "blank out" the newly allocated memory */
memset(session, 0, amount * sizeof(struct curl_ssl_session));
/* store the info in the SSL section */
data->set.ssl.numsessions = amount;
data->state.session = session;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment