summaryrefslogtreecommitdiffstats
path: root/ripd
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 /ripd
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 'ripd')
-rw-r--r--ripd/ripd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 2a0752253..bededba7f 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -132,8 +132,7 @@ static int rip_garbage_collect(struct thread *t)
/* Unlock route_node. */
listnode_delete(rp->info, rinfo);
if (list_isempty((struct list *)rp->info)) {
- list_free(rp->info);
- rp->info = NULL;
+ list_delete_and_null((struct list **)&rp->info);
route_unlock_node(rp);
}