diff --git a/src/net/collections/list.c b/src/net/collections/list.c index 2e5eb61..e7c93e7 100644 --- a/src/net/collections/list.c +++ b/src/net/collections/list.c @@ -41,8 +41,10 @@ void delete_node(list_node* node) { if (node == NULL) return; - node->previous->next = node->next; - node->next->previous = node->previous; + if (node->previous != NULL) + node->previous->next = node->next; + if (node->next != NULL) + node->next->previous = node->previous; free(node); }