0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-17 08:38:42 +00:00

Uninitialized list nodes fixes

This commit is contained in:
Maria Matejka 2019-08-17 14:18:41 +02:00
parent 258be56539
commit 3bb10b4d31
2 changed files with 2 additions and 1 deletions

View File

@ -340,6 +340,7 @@ mb_alloc(pool *p, unsigned size)
struct mblock *b = xmalloc(sizeof(struct mblock) + size); struct mblock *b = xmalloc(sizeof(struct mblock) + size);
b->r.class = &mb_class; b->r.class = &mb_class;
b->r.n = (node) {};
add_tail(&p->inside, &b->r.n); add_tail(&p->inside, &b->r.n);
b->size = size; b->size = size;
return b->data; return b->data;

View File

@ -2304,7 +2304,7 @@ rt_commit(struct config *new, struct config *old)
WALK_LIST(r, new->tables) WALK_LIST(r, new->tables)
if (!r->table) 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); DBG("\t%s: created\n", r->name);
rt_setup(rt_table_pool, t, r); rt_setup(rt_table_pool, t, r);
add_tail(&routing_tables, &t->n); add_tail(&routing_tables, &t->n);