memif: memory leak when deleting memif interface 59/35159/2
authorSteven Luong <sluong@cisco.com>
Mon, 31 Jan 2022 21:30:37 +0000 (13:30 -0800)
committerDamjan Marion <dmarion@me.com>
Mon, 7 Feb 2022 19:04:18 +0000 (19:04 +0000)
When deleting a memif interface, there is a memory leak in
mif->local_disc_string. The code that leads to memory leak is
memif_delete_if -> memif_disconect -> vec_dup

Type: fix

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

src/plugins/memif/memif.c

index 5da7362..f2575fd 100644 (file)
@@ -873,6 +873,7 @@ memif_delete_if (vlib_main_t * vm, memif_if_t * mif)
        }
     }
 
+  vec_free (mif->local_disc_string);
   clib_memset (mif, 0, sizeof (*mif));
   pool_put (mm->interfaces, mif);