Fix LinkedList_Remove

The previous version was setting to NULL both tail and head when
removing the head or tail item. That was corrupting the list.
This commit is contained in:
Hardening 2014-02-07 14:30:38 +01:00
parent 7f49c7302d
commit 600047df4f

View File

@ -192,8 +192,11 @@ void LinkedList_Remove(wLinkedList* list, void* value)
if (node->next)
node->next->prev = node->prev;
if ((!node->prev) && (!node->next))
list->head = list->tail = NULL;
if (node == list->head)
list->head = node->next;
if (node == list->tail)
list->tail = node->prev;
free(node);