Commit 804d5dd3 authored by Pekka Paalanen's avatar Pekka Paalanen
Browse files

util: clear pointers on wl_list_remove()

Set the next and prev pointers of the removed list element to NULL. This
will catch programming errors that would use invalid list pointers,
double-remove for instance.

It also helps debugging, making it easy to see in gdb if an object is
not in a list.
Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <>
parent ab6b0738
...@@ -49,6 +49,8 @@ wl_list_remove(struct wl_list *elm) ...@@ -49,6 +49,8 @@ wl_list_remove(struct wl_list *elm)
{ {
elm->prev->next = elm->next; elm->prev->next = elm->next;
elm->next->prev = elm->prev; elm->next->prev = elm->prev;
elm->next = NULL;
elm->prev = NULL;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment