aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/url.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/url.c b/lib/url.c
index 85fef52c0..894f07802 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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;