From b5348aef10c48b9ff8a4014a03352068d768d93a Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Tue, 19 Aug 2008 17:06:10 -0700 Subject: [PATCH] Initialize the table structures to zero. --- switch/table-hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/switch/table-hash.c b/switch/table-hash.c index 3e3cb768..0076537e 100644 --- a/switch/table-hash.c +++ b/switch/table-hash.c @@ -212,6 +212,7 @@ struct sw_table *table_hash_create(unsigned int polynomial, th = malloc(sizeof *th); if (th == NULL) return NULL; + memset(th, '\0', sizeof *th); assert(!(n_buckets & (n_buckets - 1))); th->buckets = calloc(n_buckets, sizeof *th->buckets); @@ -337,6 +338,7 @@ struct sw_table *table_hash2_create(unsigned int poly0, unsigned int buckets0, t2 = malloc(sizeof *t2); if (t2 == NULL) return NULL; + memset(t2, '\0', sizeof *t2); t2->subtable[0] = table_hash_create(poly0, buckets0); if (t2->subtable[0] == NULL) -- 2.30.2