From 167993254a5cbe11a1f44fad1e8ae042089c1619 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 5 Jul 2012 16:17:56 +1000 Subject: [PATCH] list.h: don't crash when removing an element from a NULL list Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard --- include/list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/list.h b/include/list.h index 96c0bcbd6..d54a207b1 100644 --- a/include/list.h +++ b/include/list.h @@ -453,7 +453,7 @@ xorg_list_is_empty(struct xorg_list *head) #define nt_list_del(_entry, _list, _type, _member) \ do { \ _type *__e = _entry; \ - if (__e == NULL) break; \ + if (__e == NULL || _list == NULL) break; \ if ((_list) == __e) { \ _list = __e->_member; \ } else { \