]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix a compile-time memory corruption error causing cf_gen to fail
authorhno <>
Tue, 18 Sep 2007 02:21:23 +0000 (02:21 +0000)
committerhno <>
Tue, 18 Sep 2007 02:21:23 +0000 (02:21 +0000)
The change to include dependency tracking had a small memory allocation
error resulting in memory corruption, causing cf_gen to fail during the
compile on some platforms/compilers.

src/cf_gen.cc

index 17a5407132ac5b424e830a440fa512849b77527c..802b8e4bb01368bab7893b3431a7fe086e89e99e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cf_gen.cc,v 1.61 2007/09/04 17:39:57 hno Exp $
+ * $Id: cf_gen.cc,v 1.62 2007/09/17 20:21:23 hno Exp $
  *
  * DEBUG: none          Generate squid.conf.default and cf_parser.h
  * AUTHOR: Max Okumoto
@@ -205,7 +205,7 @@ main(int argc, char *argv[])
        Type *t = (Type *)xcalloc(1, sizeof(*t));
        t->name = xstrdup(type);
        while ((dep = strtok(NULL, WS)) != NULL) {
-           TypeDep *d = (TypeDep *)xcalloc(1, sizeof(*dep));
+           TypeDep *d = (TypeDep *)xcalloc(1, sizeof(*d));
            d->name = xstrdup(dep);
            d->next = t->depend;
            t->depend = d;