From: Felix Fietkau Date: Fri, 28 Jun 2013 11:05:06 +0000 (+0200) Subject: safe_list: add missing null pointer check in safe_list_del() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=316e3fb6c28ab3a2244d059fc3b9429df8cc9f0a;p=oweals%2Flibubox.git safe_list: add missing null pointer check in safe_list_del() Signed-off-by: Felix Fietkau --- diff --git a/safe_list.c b/safe_list.c index d9f211f..f26b4dd 100644 --- a/safe_list.c +++ b/safe_list.c @@ -108,7 +108,8 @@ void safe_list_del(struct safe_list *list) next->i = list->i; list->i->head = &next->i; *tail = next_i; - next_i->head = tail; + if (next_i) + next_i->head = tail; list->i = NULL; }