summaryrefslogtreecommitdiff
path: root/lib/lists.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-03-22 13:35:40 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-03-23 02:21:42 +0100
commit665b8e5283df4f64eb44d8fb434489be1474b5d4 (patch)
treeef39499819c6c674a75647551d4f1fec2f9098f2 /lib/lists.c
parent39a6b19d6d7e420805bd75783b77bf442745bccb (diff)
Birdlib: Do cleanups after remove/free
To avoid byzantine behavior in case of some errors, linked lists are cleared after rem_node() and resource headers are cleared after rfree().
Diffstat (limited to 'lib/lists.c')
-rw-r--r--lib/lists.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/lists.c b/lib/lists.c
index d323a4b6..20a9a072 100644
--- a/lib/lists.c
+++ b/lib/lists.c
@@ -88,7 +88,7 @@ insert_node(node *n, node *after)
* rem_node - remove a node from a list
* @n: node to be removed
*
- * Removes a node @n from the list it's linked in.
+ * Removes a node @n from the list it's linked in. Afterwards, node @n is cleared.
*/
LIST_INLINE void
rem_node(node *n)
@@ -98,23 +98,6 @@ rem_node(node *n)
z->next = x;
x->prev = z;
-}
-
-/**
- * rem2_node - remove a node from a list, with cleanup
- * @n: node to be removed
- *
- * Removes a node @n from the list it's linked in and resets its pointers to NULL.
- * Useful if you want to distinguish between linked and unlinked nodes.
- */
-LIST_INLINE void
-rem2_node(node *n)
-{
- node *z = n->prev;
- node *x = n->next;
-
- z->next = x;
- x->prev = z;
n->next = NULL;
n->prev = NULL;
}