]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix memory leak on re-enter case
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 20 Mar 2018 22:41:00 +0000 (18:41 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 20 Mar 2018 22:41:00 +0000 (18:41 -0400)
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>
zebra/zebra_vty.c

index 35d4bd533d3c29b3d43aaf39a19b4197b08c9890..858bc417d7616649d51cd6f84776b1847b91ff21 100644 (file)
@@ -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