diff options
Diffstat (limited to 'libc/list.c')
-rw-r--r-- | libc/list.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/list.c b/libc/list.c index f96fb27..cf51e33 100644 --- a/libc/list.c +++ b/libc/list.c @@ -130,6 +130,7 @@ struct list *list_remove(struct list *list, struct node *node) } iterator->prev->next = iterator->next; - iterator->next->prev = iterator->prev; + if (iterator->next) + iterator->next->prev = iterator->prev; return list; } |