]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
use calloc, not malloc
authorwessels <>
Fri, 27 Jun 1997 05:02:15 +0000 (05:02 +0000)
committerwessels <>
Fri, 27 Jun 1997 05:02:15 +0000 (05:02 +0000)
src/cf_gen.cc

index ac2b55e013cd765fbb741196ea5a10ef1d026559..8e2ec4dbc4b49dca68de9a34a7f4bdabc914a2ca 100644 (file)
@@ -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;