From: Daniel Stenberg Date: Sat, 20 Dec 2008 22:51:57 +0000 (+0000) Subject: malloc+memset => calloc X-Git-Tag: curl-7_19_3~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a868173497c0b7ae251537903ee9941dddebeba;p=curl malloc+memset => calloc --- diff --git a/lib/formdata.c b/lib/formdata.c index 08ccf4db3..10f2caeac 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -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) diff --git a/lib/share.c b/lib/share.c index 838a15916..382e4b3d0 100644 --- a/lib/share.c +++ b/lib/share.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, , 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<