fib: ip6 and mpls fib_table memory leaks on fib_table->ft_locks 62/35262/3
authorSteven Luong <sluong@cisco.com>
Tue, 8 Feb 2022 15:59:11 +0000 (07:59 -0800)
committerNeale Ranns <neale@graphiant.com>
Wed, 9 Feb 2022 14:45:20 +0000 (14:45 +0000)
ip6 and mpls fib_table->ft_locks memory leaked when the table is
deleted.
name tag is leaked for mpls table parsing.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ife68c0ddc3a6f9437a149b308310f042799c2116

src/vnet/fib/ip6_fib.c
src/vnet/fib/mpls_fib.c
src/vnet/mpls/mpls.c

index 708fddc..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);
index 0ed2413..34369fc 100644 (file)
@@ -275,6 +275,7 @@ mpls_fib_table_destroy (u32 fib_index)
     }
     hash_free(mf->mf_entries);
 
+    vec_free (fib_table->ft_locks);
     vec_free(fib_table->ft_src_route_counts);
     pool_put(mpls_main.mpls_fibs, mf);
     pool_put(mpls_main.fibs, fib_table);
index 4076a89..0d01010 100644 (file)
@@ -425,8 +425,9 @@ vnet_mpls_table_cmd (vlib_main_t * vm,
     }
 
  done:
-  unformat_free (line_input);
-  return error;
+   vec_free (name);
+   unformat_free (line_input);
+   return error;
 }
 
 /* *INDENT-ON* */