]> sjero.net Git - wget/blobdiff - src/cookies.c
[svn] Use new macros xnew, xnew0, xnew_array, and xnew0_array in various places.
[wget] / src / cookies.c
index 091c1f53a4d4d37836ea9c2e17d323658b517fd3..07cfdc8ad14721b2353420424502cac6e041748c 100644 (file)
@@ -90,7 +90,7 @@ time_t cookies_now;
 struct cookie_jar *
 cookie_jar_new (void)
 {
-  struct cookie_jar *jar = xmalloc (sizeof (struct cookie_jar));
+  struct cookie_jar *jar = xnew (struct cookie_jar);
   jar->chains = make_nocase_string_hash_table (0);
   jar->cookie_count = 0;
   return jar;
@@ -118,8 +118,6 @@ struct cookie {
   char *attr;                  /* cookie attribute name */
   char *value;                 /* cookie attribute value */
 
-  struct cookie_jar *jar;      /* pointer back to the cookie jar, for
-                                  convenience. */
   struct cookie *next;         /* used for chaining of cookies in the
                                   same domain. */
 };
@@ -132,8 +130,7 @@ struct cookie {
 static struct cookie *
 cookie_new (void)
 {
-  struct cookie *cookie = xmalloc (sizeof (struct cookie));
-  memset (cookie, '\0', sizeof (struct cookie));
+  struct cookie *cookie = xnew0 (struct cookie);
 
   /* Both cookie->permanent and cookie->expiry_time are now 0.  By
      default, we assume that the cookie is non-permanent and valid