From: Pekka Paalanen Date: Wed, 9 Nov 2011 14:27:07 +0000 (+0200) Subject: util: clear pointers on wl_list_remove() X-Git-Tag: 0.85.0~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=804d5dd348567fd286b8aa5101d3aff95ecd69d7;p=profile%2Fivi%2Fwayland.git 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 --- diff --git a/src/wayland-util.c b/src/wayland-util.c index 647b861..06bd245 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -49,6 +49,8 @@ wl_list_remove(struct wl_list *elm) { elm->prev->next = elm->next; elm->next->prev = elm->prev; + elm->next = NULL; + elm->prev = NULL; } WL_EXPORT int