aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-02-26 14:52:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-02-26 14:52:16 +0000
commit7d8cd5906c890f8e4c7ceae1b5f9e650fe81e08b (patch)
tree81c1089a5dd8cbaafd05093fb4a58a6d6f28774f
parent1056d2d22dbb41cd52fea9a75d20d637c0126ba5 (diff)
use calloc instead of malloc and we won't have to memset() the struct
-rw-r--r--lib/cookie.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index 7b9caf3c8..d566df503 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -158,13 +158,10 @@ Curl_cookie_add(struct SessionHandle *data,
bool badcookie = FALSE; /* cookies are good by default. mmmmm yummy */
/* First, alloc and init a new struct for it */
- co = (struct Cookie *)malloc(sizeof(struct Cookie));
+ co = (struct Cookie *)calloc(sizeof(struct Cookie), 1);
if(!co)
return NULL; /* bail out if we're this low on memory */
- /* clear the whole struct first */
- memset(co, 0, sizeof(struct Cookie));
-
if(httpheader) {
/* This line was read off a HTTP-header */
char *sep;