aboutsummaryrefslogtreecommitdiff
path: root/libc/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/list.c')
-rw-r--r--libc/list.c3
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;
}