From b91299153d809c9243add21cf637d6aa24c36fc2 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 9 Oct 2018 20:19:01 -0400 Subject: [PATCH] bgpd: Cleanup memory leak with the martian address intf string When cleaning up a interface string, from the linked list we were dropping the name pointer which held the allocated martian address intf string. Signed-off-by: Donald Sharp --- bgpd/bgp_nexthop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 4f246fdd11..45c596254f 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -305,8 +305,10 @@ static void bgp_address_del(struct bgp *bgp, struct connected *ifc, break; } - if (node) + if (node) { list_delete_node(addr->ifp_name_list, node); + XFREE(MTYPE_MARTIAN_STRING, name); + } if (addr->ifp_name_list->count == 0) { hash_release(bgp->address_hash, addr); -- 2.39.5