mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 13:20:12 +00:00
isisd: fix a memory leak in isis_spftree_clear()
isis_spftree_clear() calls:
- _isis_spftree_del() to partially delete a spftree instance
without freeing spftree->route_table and
spftree->route_table_backup.
- then _isis_spftree_init() that allocates new spftree->route_table
and spftree->route_table_backup.
As a consequence, the previous table instances are not referenced and
not freed.
Free the route tables before allocating new ones.
Fixes: 860b75b40e
("isisd: calculate flex-algo constraint spf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
5c28462596
commit
771d544a5b
@ -393,14 +393,14 @@ static void _isis_spftree_del(struct isis_spftree *spftree)
|
||||
isis_vertex_queue_free(&spftree->paths);
|
||||
isis_route_table_info_free(spftree->route_table->info);
|
||||
isis_route_table_info_free(spftree->route_table_backup->info);
|
||||
route_table_finish(spftree->route_table);
|
||||
route_table_finish(spftree->route_table_backup);
|
||||
}
|
||||
|
||||
void isis_spftree_del(struct isis_spftree *spftree)
|
||||
{
|
||||
_isis_spftree_del(spftree);
|
||||
|
||||
route_table_finish(spftree->route_table);
|
||||
route_table_finish(spftree->route_table_backup);
|
||||
spftree->route_table = NULL;
|
||||
|
||||
XFREE(MTYPE_ISIS_SPFTREE, spftree);
|
||||
|
Loading…
Reference in New Issue
Block a user