fib: ip6 and mpls fib_table memory leaks on fib_table->ft_locks
[vpp.git] / src / vnet / fib / ip6_fib.c
index 861edcc..6c73d19 100644 (file)
@@ -174,6 +174,7 @@ ip6_fib_table_destroy (u32 fib_index)
     {
        hash_unset (ip6_main.fib_index_by_table_id, fib_table->ft_table_id);
     }
+    vec_free (fib_table->ft_locks);
     vec_free(fib_table->ft_src_route_counts);
     pool_put_index(ip6_main.v6_fibs, fib_table->ft_index);
     pool_put(ip6_main.fibs, fib_table);
@@ -264,11 +265,11 @@ compute_prefix_lengths_in_search_order (ip6_fib_table_instance_t *table)
     old = table->prefix_lengths_in_search_order;
 
     /* Note: bitmap reversed so this is in fact a longest prefix match */
-    clib_bitmap_foreach (i, table->non_empty_dst_address_length_bitmap,
-    ({
+    clib_bitmap_foreach (i, table->non_empty_dst_address_length_bitmap)
+     {
        int dst_address_length = 128 - i;
        vec_add1(prefix_lengths_in_search_order, dst_address_length);
-    }));
+    }
 
     table->prefix_lengths_in_search_order = prefix_lengths_in_search_order;
 
@@ -696,8 +697,8 @@ ip6_show_fib (vlib_main_t * vm,
         return (NULL);
     }
 
-    pool_foreach (fib_table, im6->fibs,
-    ({
+    pool_foreach (fib_table, im6->fibs)
+     {
         fib_source_t source;
         u8 *s = NULL;
 
@@ -762,7 +763,7 @@ ip6_show_fib (vlib_main_t * vm,
        {
            ip6_fib_table_show_one(fib, vm, &matching_address, mask_len, detail);
        }
-    }));
+    }
 
     return 0;
 }
@@ -772,7 +773,7 @@ ip6_show_fib (vlib_main_t * vm,
  * entries for each table.
  *
  * @note This command will run for a long time when the FIB tables are
- * comprised of millions of entries. For those senarios, consider displaying
+ * comprised of millions of entries. For those scenarios, consider displaying
  * in summary mode.
  *
  * @cliexpar