mirror of
https://github.com/hmaxnl/netex.git
synced 2025-01-18 15:34:20 +01:00
[CHANGE] added checks in 'delete_node' function.
This commit is contained in:
parent
c3a2f00edc
commit
9c8cdcd94d
|
@ -41,8 +41,10 @@ void delete_node(list_node* node)
|
||||||
{
|
{
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
return;
|
return;
|
||||||
node->previous->next = node->next;
|
if (node->previous != NULL)
|
||||||
node->next->previous = node->previous;
|
node->previous->next = node->next;
|
||||||
|
if (node->next != NULL)
|
||||||
|
node->next->previous = node->previous;
|
||||||
free(node);
|
free(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user