diff --git a/list.c b/list.c index 6dbe4782..b1627f59 100644 --- a/list.c +++ b/list.c @@ -54,6 +54,8 @@ bool list_remove(struct list *list, void *data) if (cur->data == data) { if (cur == list->head) { list->head = next; + } else { + prev->next = next; } if (cur == list->tail) { list->tail = prev;