mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 22:26:14 +00:00
ospf6d: Fix memory allocation issues in SPF
* ospf6_area.c: Call ospf6_spf_table_finish() before deleting the spf table. This ensures that the associated ospf6_vertex structures are also freed. * ospf6_spf.c: Only allocate a priority queue when a spf calculation is actually performed.
This commit is contained in:
parent
f7c91fc330
commit
158dd4d00e
@ -199,6 +199,7 @@ ospf6_area_delete (struct ospf6_area *oa)
|
|||||||
ospf6_lsdb_delete (oa->lsdb);
|
ospf6_lsdb_delete (oa->lsdb);
|
||||||
ospf6_lsdb_delete (oa->lsdb_self);
|
ospf6_lsdb_delete (oa->lsdb_self);
|
||||||
|
|
||||||
|
ospf6_spf_table_finish (oa->spf_table);
|
||||||
ospf6_route_table_delete (oa->spf_table);
|
ospf6_route_table_delete (oa->spf_table);
|
||||||
ospf6_route_table_delete (oa->route_table);
|
ospf6_route_table_delete (oa->route_table);
|
||||||
|
|
||||||
|
@ -391,10 +391,6 @@ ospf6_spf_calculation (u_int32_t router_id,
|
|||||||
caddr_t lsdesc;
|
caddr_t lsdesc;
|
||||||
struct ospf6_lsa *lsa;
|
struct ospf6_lsa *lsa;
|
||||||
|
|
||||||
/* initialize */
|
|
||||||
candidate_list = pqueue_create ();
|
|
||||||
candidate_list->cmp = ospf6_vertex_cmp;
|
|
||||||
|
|
||||||
ospf6_spf_table_finish (result_table);
|
ospf6_spf_table_finish (result_table);
|
||||||
|
|
||||||
/* Install the calculating router itself as the root of the SPF tree */
|
/* Install the calculating router itself as the root of the SPF tree */
|
||||||
@ -403,6 +399,11 @@ ospf6_spf_calculation (u_int32_t router_id,
|
|||||||
router_id, oa->lsdb);
|
router_id, oa->lsdb);
|
||||||
if (lsa == NULL)
|
if (lsa == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* initialize */
|
||||||
|
candidate_list = pqueue_create ();
|
||||||
|
candidate_list->cmp = ospf6_vertex_cmp;
|
||||||
|
|
||||||
root = ospf6_vertex_create (lsa);
|
root = ospf6_vertex_create (lsa);
|
||||||
root->area = oa;
|
root->area = oa;
|
||||||
root->cost = 0;
|
root->cost = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user