summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_topology.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-28 03:19:20 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-10-05 16:53:17 +0200
commitacdf5e25101bafe334e6b500c3dd0a2babb3c1ec (patch)
treed8b9483a3aeebc7e90ddbe5f765e5e63aecb8e1b /eigrpd/eigrp_topology.c
parent*: Convert list_delete(struct list *) to ** to allow nulling (diff)
downloadfrr-acdf5e25101bafe334e6b500c3dd0a2babb3c1ec.tar.xz
frr-acdf5e25101bafe334e6b500c3dd0a2babb3c1ec.zip
*: Convert list_free usage to list_delete
list_free is occassionally being used to delete the list and accidently not deleting all the nodes. We keep running across this usage pattern. Let's remove the temptation and only allow list_delete to handle list deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_topology.c')
-rw-r--r--eigrpd/eigrp_topology.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/eigrpd/eigrp_topology.c b/eigrpd/eigrp_topology.c
index e8532a077..94775622d 100644
--- a/eigrpd/eigrp_topology.c
+++ b/eigrpd/eigrp_topology.c
@@ -101,8 +101,7 @@ static int eigrp_prefix_entry_cmp(struct eigrp_prefix_entry *node1,
static void eigrp_prefix_entry_del(struct eigrp_prefix_entry *node)
{
- list_delete_all_node(node->entries);
- list_free(node->entries);
+ list_delete_and_null(&node->entries);
}
/*
@@ -158,7 +157,7 @@ struct eigrp_nexthop_entry *eigrp_nexthop_entry_new()
*/
void eigrp_topology_free(struct list *list)
{
- list_free(list);
+ list_delete_and_null(&list);
}
/*
@@ -217,9 +216,8 @@ void eigrp_prefix_entry_delete(struct list *topology,
listnode_delete(eigrp->topology_changes_internalIPV4, node);
if (listnode_lookup(topology, node) != NULL) {
- list_delete_all_node(node->entries);
- list_free(node->entries);
- list_free(node->rij);
+ list_delete_and_null(&node->entries);
+ list_delete_and_null(&node->rij);
listnode_delete(topology, node);
eigrp_zebra_route_delete(node->destination);
XFREE(MTYPE_EIGRP_PREFIX_ENTRY, node);