]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: Free memory associated with ospf instance startup
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 4 Oct 2017 12:04:00 +0000 (08:04 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 4 Oct 2017 12:04:00 +0000 (08:04 -0400)
We have memory that is initialized upon ospf instance
and area startup.  Free it up on shutdown.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd/ospfd.c

index d59abd42158fc08f436bab509cd6367ca39feda6..fde3f148c3f78c6561a67683ad625269c17bae7f 100644 (file)
@@ -542,6 +542,7 @@ static void ospf_finish_final(struct ospf *ospf)
        /* Reset interface. */
        for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi))
                ospf_if_free(oi);
+       list_delete(ospf->oiflist);
 
        /* Clear static neighbors */
        for (rn = route_top(ospf->nbr_nbma); rn; rn = route_next(rn))
@@ -574,6 +575,7 @@ static void ospf_finish_final(struct ospf *ospf)
                        route_unlock_node(rn);
                }
        }
+       route_table_finish(ospf->networks);
 
        for (ALL_LIST_ELEMENTS(ospf->areas, node, nnode, area)) {
                listnode_delete(ospf->areas, area);
@@ -670,6 +672,8 @@ static void ospf_finish_final(struct ospf *ospf)
        if (!CHECK_FLAG(om->options, OSPF_MASTER_SHUTDOWN))
                instance = ospf->instance;
 
+       list_delete(ospf->oi_write_q);
+
        ospf_delete(ospf);
 
        XFREE(MTYPE_OSPF_TOP, ospf);
@@ -719,6 +723,8 @@ static void ospf_area_free(struct ospf_area *area)
        struct route_node *rn;
        struct ospf_lsa *lsa;
 
+       ospf_opaque_type10_lsa_term(area);
+
        /* Free LSDBs. */
        LSDB_LOOP(ROUTER_LSDB(area), rn, lsa)
        ospf_discard_from_db(area->ospf, area->lsdb, lsa);