From: wessels <> Date: Fri, 27 Jun 1997 05:02:15 +0000 (+0000) Subject: use calloc, not malloc X-Git-Tag: SQUID_3_0_PRE1~4909 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14a313642e13e0f3290262b5f550b0db05013267;p=thirdparty%2Fsquid.git use calloc, not malloc --- diff --git a/src/cf_gen.cc b/src/cf_gen.cc index ac2b55e013..8e2ec4dbc4 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -1,5 +1,5 @@ /* - * $Id: cf_gen.cc,v 1.1 1997/06/26 22:29:30 wessels Exp $ + * $Id: cf_gen.cc,v 1.2 1997/06/26 23:02:15 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Max Okumoto @@ -121,10 +121,8 @@ main(int argc, char *argv[]) printf("Error in input file\n"); exit(1); } - curr = malloc(sizeof(Entry)); + curr = calloc(1, sizeof(Entry)); curr->name = strdup(name); - curr->loc = NULL; - curr->doc = NULL; state = s1; } else if (!strcmp(buff, "EOF")) { @@ -209,7 +207,7 @@ main(int argc, char *argv[]) state = sSTART; } else { - Line *line = malloc(sizeof(Line)); + Line *line = calloc(1, sizeof(Line)); line->data = strdup(buff); line->next = curr->doc;