From: Daniel Stenberg Date: Thu, 5 May 2005 06:04:00 +0000 (+0000) Subject: use calloc instead of malloc to save a call to memset() X-Git-Tag: curl-7_14_0~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=274842ec418e79cb841e798a58f186fd48b54ec5;p=thirdparty%2Fcurl.git use calloc instead of malloc to save a call to memset() --- diff --git a/lib/sslgen.c b/lib/sslgen.c index 5e8f753326..7592e668b8 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;