From: hno <> Date: Tue, 18 Sep 2007 02:21:23 +0000 (+0000) Subject: Fix a compile-time memory corruption error causing cf_gen to fail X-Git-Tag: SQUID_3_0_RC1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f629a662c03a8b4970f045b84b5bc678292fe896;p=thirdparty%2Fsquid.git Fix a compile-time memory corruption error causing cf_gen to fail 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. --- diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 17a5407132..802b8e4bb0 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -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;