]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Cleanup memory leak with the martian address intf string 3154/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 10 Oct 2018 00:19:01 +0000 (20:19 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 10 Oct 2018 00:19:01 +0000 (20:19 -0400)
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 <sharpd@cumulusnetworks.com>
bgpd/bgp_nexthop.c

index 4f246fdd110d964b37ff1fa15ee884d967c896e5..45c596254f61982d4a065a36034f46df51ef1b88 100644 (file)
@@ -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);