[CHANGE] added checks in 'delete_node' function.

This commit is contained in:
max 2024-10-28 19:47:07 +01:00
parent c3a2f00edc
commit 9c8cdcd94d

View File

@ -41,7 +41,9 @@ void delete_node(list_node* node)
{
if (node == NULL)
return;
if (node->previous != NULL)
node->previous->next = node->next;
if (node->next != NULL)
node->next->previous = node->previous;
free(node);
}