From af5849b6628695a945f70eb195c2049d1bbb3dfb Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 20 Mar 2018 18:41:00 -0400 Subject: [PATCH] zebra: Fix memory leak on re-enter case When we have a case where the user re-enters the same ip route line, we need to delete the memory we just malloc'ed. Signed-off-by: Donald Sharp --- zebra/zebra_vty.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 35d4bd533d..858bc417d7 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -249,6 +249,9 @@ static int zebra_static_route_holdem(struct zebra_vrf *zvrf, return CMD_SUCCESS; } + XFREE(MTYPE_STATIC_ROUTE, shr->nhvrf_name); + XFREE(MTYPE_STATIC_ROUTE, shr->vrf_name); + XFREE(MTYPE_STATIC_ROUTE, shr); /* * If a person enters the same line again * we need to silently accept it -- 2.39.5