mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 23:33:08 +00:00
Merge pull request #13235 from Orange-OpenSource/link-state
lib: Fix memory leaks in Link State library
This commit is contained in:
commit
9ab0661b89
@ -497,7 +497,6 @@ void ls_vertex_del(struct ls_ted *ted, struct ls_vertex *vertex)
|
|||||||
/* Then remove Vertex from Link State Data Base and free memory */
|
/* Then remove Vertex from Link State Data Base and free memory */
|
||||||
vertices_del(&ted->vertices, vertex);
|
vertices_del(&ted->vertices, vertex);
|
||||||
XFREE(MTYPE_LS_DB, vertex);
|
XFREE(MTYPE_LS_DB, vertex);
|
||||||
vertex = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ls_vertex_del_all(struct ls_ted *ted, struct ls_vertex *vertex)
|
void ls_vertex_del_all(struct ls_ted *ted, struct ls_vertex *vertex)
|
||||||
@ -956,7 +955,10 @@ struct ls_subnet *ls_find_subnet(struct ls_ted *ted,
|
|||||||
{
|
{
|
||||||
struct ls_subnet subnet = {};
|
struct ls_subnet subnet = {};
|
||||||
|
|
||||||
subnet.key = *prefix;
|
if (!prefix)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
prefix_copy(&subnet.key, prefix);
|
||||||
return subnets_find(&ted->subnets, &subnet);
|
return subnets_find(&ted->subnets, &subnet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1779,9 +1781,10 @@ struct ls_vertex *ls_msg2vertex(struct ls_ted *ted, struct ls_message *msg,
|
|||||||
case LS_MSG_EVENT_DELETE:
|
case LS_MSG_EVENT_DELETE:
|
||||||
vertex = ls_find_vertex_by_id(ted, node->adv);
|
vertex = ls_find_vertex_by_id(ted, node->adv);
|
||||||
if (vertex) {
|
if (vertex) {
|
||||||
if (delete)
|
if (delete) {
|
||||||
ls_vertex_del_all(ted, vertex);
|
ls_vertex_del_all(ted, vertex);
|
||||||
else
|
vertex = NULL;
|
||||||
|
} else
|
||||||
vertex->status = DELETE;
|
vertex->status = DELETE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1858,9 +1861,10 @@ struct ls_subnet *ls_msg2subnet(struct ls_ted *ted, struct ls_message *msg,
|
|||||||
case LS_MSG_EVENT_DELETE:
|
case LS_MSG_EVENT_DELETE:
|
||||||
subnet = ls_find_subnet(ted, &pref->pref);
|
subnet = ls_find_subnet(ted, &pref->pref);
|
||||||
if (subnet) {
|
if (subnet) {
|
||||||
if (delete)
|
if (delete) {
|
||||||
ls_subnet_del_all(ted, subnet);
|
ls_subnet_del_all(ted, subnet);
|
||||||
else
|
subnet = NULL;
|
||||||
|
} else
|
||||||
subnet->status = DELETE;
|
subnet->status = DELETE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user