mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
malloc+memset => calloc
This commit is contained in:
parent
5be7d88b34
commit
2a86817349
@ -222,9 +222,8 @@ static FormInfo * AddFormInfo(char *value,
|
||||
FormInfo *parent_form_info)
|
||||
{
|
||||
FormInfo *form_info;
|
||||
form_info = malloc(sizeof(FormInfo));
|
||||
form_info = calloc(sizeof(FormInfo), 1);
|
||||
if(form_info) {
|
||||
memset(form_info, 0, sizeof(FormInfo));
|
||||
if(value)
|
||||
form_info->value = value;
|
||||
if(contenttype)
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -36,11 +36,9 @@
|
||||
CURLSH *
|
||||
curl_share_init(void)
|
||||
{
|
||||
struct Curl_share *share = malloc(sizeof(struct Curl_share));
|
||||
if(share) {
|
||||
memset (share, 0, sizeof(struct Curl_share));
|
||||
struct Curl_share *share = calloc(sizeof(struct Curl_share), 1);
|
||||
if(share)
|
||||
share->specifier |= (1<<CURL_LOCK_DATA_SHARE);
|
||||
}
|
||||
|
||||
return share;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user