aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-05-05 06:04:00 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-05-05 06:04:00 +0000
commit274842ec418e79cb841e798a58f186fd48b54ec5 (patch)
tree7a35493dd6300129c12fdb77f561d14bcf612c75
parentc06da7c84aa4b21a802b6992d373f7aa2c944c76 (diff)
use calloc instead of malloc to save a call to memset()
-rw-r--r--lib/sslgen.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/sslgen.c b/lib/sslgen.c
index 5e8f75332..7592e668b 100644
--- a/lib/sslgen.c
+++ b/lib/sslgen.c
@@ -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;