VPP-361: Memory leak on delete of VXLAN over IPv6 tunnel 43/2543/2
authorJohn Lo <loj@cisco.com>
Tue, 30 Aug 2016 04:10:09 +0000 (00:10 -0400)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 30 Aug 2016 10:52:34 +0000 (10:52 +0000)
The key for VXLAN over IPv6 tunnel is allocated on create and should
be freed on delete.

Change-Id: I11bdd9465030fed57cc4bbd28dbccdf952633b34
Signed-off-by: John Lo <loj@cisco.com>
vnet/vnet/vxlan/vxlan.c

index 86d4924..e10c0a8 100644 (file)
@@ -360,7 +360,10 @@ int vnet_vxlan_add_del_tunnel
       if (!a->is_ip6)
         hash_unset (vxm->vxlan4_tunnel_by_key, key4.as_u64);
       else
-        hash_unset_mem (vxm->vxlan6_tunnel_by_key, t->key6);
+        {
+         hash_unset_mem (vxm->vxlan6_tunnel_by_key, t->key6);
+         clib_mem_free (t->key6);
+       }
 
       vec_free (t->rewrite);
       pool_put (vxm->tunnels, t);