summaryrefslogtreecommitdiffstats
path: root/lib/linklist.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 /lib/linklist.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 'lib/linklist.c')
-rw-r--r--lib/linklist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/linklist.c b/lib/linklist.c
index 2f9e7c1e3..2306dd6d0 100644
--- a/lib/linklist.c
+++ b/lib/linklist.c
@@ -33,7 +33,7 @@ struct list *list_new(void)
}
/* Free list. */
-void list_free(struct list *l)
+static void list_free_internal(struct list *l)
{
XFREE(MTYPE_LINK_LIST, l);
}
@@ -252,7 +252,7 @@ void list_delete_and_null(struct list **list)
{
assert(*list);
list_delete_all_node(*list);
- list_free(*list);
+ list_free_internal(*list);
*list = NULL;
}