]> granicus.if.org Git - curl/commitdiff
malloc+memset => calloc
authorDaniel Stenberg <daniel@haxx.se>
Sat, 20 Dec 2008 22:51:57 +0000 (22:51 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 20 Dec 2008 22:51:57 +0000 (22:51 +0000)
lib/formdata.c
lib/share.c

index 08ccf4db3095644df359aef91039ec8afef7b530..10f2caeac88df09086fa2328ebb7c6d4584590f4 100644 (file)
@@ -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)
index 838a159164c905250bdd7b5a7f84fcafb442d3fd..382e4b3d051fd081d6c4ce799e82a96d30ab7ff2 100644 (file)
@@ -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
 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;
 }