]> git.puffer.fish Git - mirror/frr.git/commitdiff
Revert "ospfd: Free memory associated with ospf instance startup"
authorMartin Winter <mwinter@opensourcerouting.org>
Thu, 12 Oct 2017 00:56:17 +0000 (17:56 -0700)
committerMartin Winter <mwinter@opensourcerouting.org>
Thu, 12 Oct 2017 00:58:46 +0000 (17:58 -0700)
This reverts commit 79942104bff838362cd6609485a26617492aa6f5.
The original commit causes a heap-use-after-free. See issue
https://github.com/FRRouting/frr/issues/1326

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
ospfd/ospfd.c

index fde3f148c3f78c6561a67683ad625269c17bae7f..d59abd42158fc08f436bab509cd6367ca39feda6 100644 (file)
@@ -542,7 +542,6 @@ 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))
@@ -575,7 +574,6 @@ 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);
@@ -672,8 +670,6 @@ 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);
@@ -723,8 +719,6 @@ 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);