summaryrefslogtreecommitdiff
path: root/lib/share.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-12-20 22:51:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-12-20 22:51:57 +0000
commit2a868173497c0b7ae251537903ee9941dddebeba (patch)
tree26f28994eebcb73f17bbe174ffdc5ff56aa4cadd /lib/share.c
parent5be7d88b34873ef6e16ace91ba6d89f4b3203e61 (diff)
downloadcurl-2a868173497c0b7ae251537903ee9941dddebeba.tar.gz
malloc+memset => calloc
Diffstat (limited to 'lib/share.c')
-rw-r--r--lib/share.c8
1 files changed, 3 insertions, 5 deletions
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, <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;
}