]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Uninitialized list nodes fixes
authorMaria Matejka <mq@ucw.cz>
Sat, 17 Aug 2019 12:18:41 +0000 (14:18 +0200)
committerMaria Matejka <mq@ucw.cz>
Sat, 17 Aug 2019 12:18:41 +0000 (14:18 +0200)
filter/config.Y
lib/resource.c
nest/rt-table.c

index a83510d72e1d52155a79f987b68a51cf877840d1..e8e53cc4e17186a99b334f6b8477d98c23b81332 100644 (file)
@@ -462,7 +462,7 @@ bt_test_suite:
   if (!($3->class & SYM_FUNCTION))
     cf_error("Function expected");
 
-  struct f_bt_test_suite *t = cfg_alloc(sizeof(struct f_bt_test_suite));
+  struct f_bt_test_suite *t = cfg_allocz(sizeof(struct f_bt_test_suite));
   t->fn = $3->def;
   t->fn_name = $3->name;
   t->dsc = $5;
index ab8c800f5b9e1cadb1ce20c1ea5bc4b31c6ff8c2..7e6243212be673aa25aeecfc0049a22480d7b56c 100644 (file)
@@ -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;
index 429df0ba5ccd01bc0a6d69a53154b231c007279e..1bb31bd870e342be1ef7c4967f6b3d2e30dfdda1 100644 (file)
@@ -2301,7 +2301,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);