From 10ac25160c0d1211698b7b7a78b6d1505ac11c89 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 4 Jun 2018 13:31:34 -0400 Subject: [PATCH] zebra: Fix memory leak on host prefix removal When we have a host prefix, actually free the alloced memory associated with it when we free it. Signed-off-by: Donald Sharp --- zebra/zebra_vxlan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 90604215e..74c1f3f17 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3111,8 +3111,10 @@ static void rb_delete_host(struct host_rb_tree_entry *hrbe, struct prefix *host) memcpy(&lookup.p, host, sizeof(*host)); hle = RB_FIND(host_rb_tree_entry, hrbe, &lookup); - if (hle) + if (hle) { RB_REMOVE(host_rb_tree_entry, hrbe, hle); + XFREE(MTYPE_HOST_PREFIX, hle); + } return; } -- 2.39.5