From: wessels <> Date: Mon, 29 May 2000 04:42:39 +0000 (+0000) Subject: DW: X-Git-Tag: SQUID_3_0_PRE1~1969 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8646c00a610abced64297d6f835b91906fca3e68;p=thirdparty%2Fsquid.git DW: - Uninitialized memory is a bad thing. Use xcalloc instead. - xcalloc never returns NULL. It either succeeds or the process aborts. --- diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index 075c9f7fbb..1eb38a08ca 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -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;