Skip to content
Snippets Groups Projects
Commit e40641bf authored by Gisle Vanem's avatar Gisle Vanem
Browse files

Use calloc() instead.

parent 27c0b438
No related branches found
No related tags found
No related merge requests found
......@@ -369,13 +369,10 @@ CURLcode Curl_open(struct SessionHandle **curl)
/* create an array with connection data struct pointers */
data->state.numconnects = 5; /* hard-coded right now */
data->state.connects = (struct connectdata **)
malloc(sizeof(struct connectdata *) * data->state.numconnects);
calloc(sizeof(struct connectdata *) * data->state.numconnects, 1);
if(!data->state.connects)
res = CURLE_OUT_OF_MEMORY;
else
memset(data->state.connects, 0,
sizeof(struct connectdata *)*data->state.numconnects);
/* most recent connection is not yet defined */
data->state.lastconnect = -1;
......
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