]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Mon, 29 May 2000 04:42:39 +0000 (04:42 +0000)
committerwessels <>
Mon, 29 May 2000 04:42:39 +0000 (04:42 +0000)
 - Uninitialized memory is a bad thing.  Use xcalloc instead.
 - xcalloc never returns NULL.  It either succeeds or the process aborts.

src/fs/diskd/store_dir_diskd.cc

index 075c9f7fbba988ae59efff4e898546dd13d2d380..1eb38a08cafe6840e77152eb3376821cf4fe8267 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.cc,v 1.4 2000/05/12 04:06:34 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.5 2000/05/28 22:42:39 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -2022,14 +2022,10 @@ storeDiskdDirParse(SwapDir * sd, int index, char *path)
        if (!strcasecmp(token, "read-only"))
            read_only = 1;
 
-    diskdinfo = xmalloc(sizeof(diskdinfo_t));
-    if (diskdinfo == NULL)
-       fatal("storeDiskdDirParse: couldn't xmalloc() diskdinfo_t!\n");
-
+    sd->fsdata = diskdinfo = xcalloc(1, sizeof(*diskdinfo));
     sd->index = index;
     sd->path = xstrdup(path);
     sd->max_size = size;
-    sd->fsdata = diskdinfo;
     diskdinfo->l1 = l1;
     diskdinfo->l2 = l2;
     diskdinfo->swaplog_fd = -1;