]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Slab: Init node in slab head to NULLs. mq-static-analysis
authorMaria Matejka <mq@ucw.cz>
Mon, 19 Aug 2019 12:43:14 +0000 (14:43 +0200)
committerMaria Matejka <mq@ucw.cz>
Fri, 1 May 2020 13:19:12 +0000 (15:19 +0200)
lib/slab.c

index 5c414f9e126ceba7f4786f3600a2bbdfe05f4ea1..c3035b45b222a3e17ad9d2acd8b1ed66c1a9d3a4 100644 (file)
@@ -216,8 +216,11 @@ sl_new_head(slab *s)
   struct sl_obj *no;
   uint n = s->objs_per_slab;
 
-  h->first_free = o;
-  h->num_full = 0;
+  *h = (struct sl_head) {
+    .first_free = o,
+    .num_full = 0,
+  };
+
   while (n--)
     {
       o->slab = h;