summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-03-20 23:41:00 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-03-20 23:41:00 +0100
commitaf5849b6628695a945f70eb195c2049d1bbb3dfb (patch)
tree3495798a45aea567842167f51f3aea94f6d1fafb
parentMerge pull request #1825 from chiragshah6/ospfv3_dev (diff)
downloadfrr-af5849b6628695a945f70eb195c2049d1bbb3dfb.tar.xz
frr-af5849b6628695a945f70eb195c2049d1bbb3dfb.zip
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 <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/zebra_vty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 35d4bd533..858bc417d 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