~ubuntu-branches/ubuntu/natty/curl/natty-proposed

« back to all changes in this revision

Viewing changes to lib/share.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-05-24 21:12:19 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090524211219-7jgcwuhl04ixuqsm
Tags: upstream-7.19.5
ImportĀ upstreamĀ versionĀ 7.19.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: share.c,v 1.24 2008-03-18 08:14:37 mmarek Exp $
 
21
 * $Id: share.c,v 1.28 2009-04-21 11:46:17 yangtse Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
28
28
#include <curl/curl.h>
29
29
#include "urldata.h"
30
30
#include "share.h"
31
 
#include "memory.h"
 
31
#include "curl_memory.h"
32
32
 
33
33
/* The last #include file should be: */
34
34
#include "memdebug.h"
36
36
CURLSH *
37
37
curl_share_init(void)
38
38
{
39
 
  struct Curl_share *share =
40
 
    (struct Curl_share *)malloc(sizeof(struct Curl_share));
41
 
  if(share) {
42
 
    memset (share, 0, sizeof(struct Curl_share));
 
39
  struct Curl_share *share = calloc(sizeof(struct Curl_share), 1);
 
40
  if(share)
43
41
    share->specifier |= (1<<CURL_LOCK_DATA_SHARE);
44
 
  }
45
42
 
46
43
  return share;
47
44
}
169
166
    return CURLSHE_IN_USE;
170
167
  }
171
168
 
172
 
  if(share->hostcache)
 
169
  if(share->hostcache) {
173
170
    Curl_hash_destroy(share->hostcache);
 
171
    share->hostcache = NULL;
 
172
  }
174
173
 
175
174
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
176
175
  if(share->cookies)