diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-07-05 16:17:56 +1000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-05 10:09:18 -0700 |
commit | 167993254a5cbe11a1f44fad1e8ae042089c1619 (patch) | |
tree | 18cbe55f8c2c1470e605b81038aab876acb6e8d6 | |
parent | 8aa6d49d46dacc31a85023d0159c1fb67401df73 (diff) |
list.h: don't crash when removing an element from a NULL list
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | include/list.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 { \ |