From 694e953cb8f2ce9e2da5c3d41cf056e3911ceca4 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 19 Jul 2019 21:49:25 +0200 Subject: libutil.a: make sure str_table_init initializes all fields Signed-off-by: David Oberhollenzer --- lib/util/str_table.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/util') diff --git a/lib/util/str_table.c b/lib/util/str_table.c index 6363c81..a9d91e5 100644 --- a/lib/util/str_table.c +++ b/lib/util/str_table.c @@ -45,6 +45,8 @@ static int strings_grow(str_table_t *table) int str_table_init(str_table_t *table, size_t size) { + memset(table, 0, sizeof(*table)); + table->buckets = calloc(size, sizeof(table->buckets[0])); table->num_buckets = size; -- cgit v1.2.3