aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-08-17 14:18:41 +0200
committerMaria Matejka <mq@ucw.cz>2020-05-01 15:19:12 +0200
commit3bb10b4d31d68a8139e284c27f7eb6fca897721d (patch)
treec86de6849dae9309e5585f768fc738e279de3954
parent258be56539a3d4b47fe779f9658ca3d88761878d (diff)
downloadbird-3bb10b4d31d68a8139e284c27f7eb6fca897721d.tar.gz
Uninitialized list nodes fixes
-rw-r--r--lib/resource.c1
-rw-r--r--nest/rt-table.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/resource.c b/lib/resource.c
index ab8c800f..7e624321 100644
--- a/lib/resource.c
+++ b/lib/resource.c
@@ -340,6 +340,7 @@ mb_alloc(pool *p, unsigned size)
struct mblock *b = xmalloc(sizeof(struct mblock) + size);
b->r.class = &mb_class;
+ b->r.n = (node) {};
add_tail(&p->inside, &b->r.n);
b->size = size;
return b->data;
diff --git a/nest/rt-table.c b/nest/rt-table.c
index a46eeb77..ae5a8444 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -2304,7 +2304,7 @@ rt_commit(struct config *new, struct config *old)
WALK_LIST(r, new->tables)
if (!r->table)
{
- rtable *t = mb_alloc(rt_table_pool, sizeof(struct rtable));
+ rtable *t = mb_allocz(rt_table_pool, sizeof(struct rtable));
DBG("\t%s: created\n", r->name);
rt_setup(rt_table_pool, t, r);
add_tail(&routing_tables, &t->n);