Skip to content
Snippets Groups Projects
Commit 4588f15d4fb4 authored by miaoerduo's avatar miaoerduo
Browse files

fix: error list head's prev when detach the last item

parent 8777557d3b97
No related branches found
No related tags found
No related merge requests found
...@@ -2210,6 +2210,12 @@ ...@@ -2210,6 +2210,12 @@
/* first element */ /* first element */
parent->child = item->next; parent->child = item->next;
} }
else if (item->next == NULL)
{
/* last element */
parent->child->prev = item->prev;
}
/* make sure the detached item doesn't point anywhere anymore */ /* make sure the detached item doesn't point anywhere anymore */
item->prev = NULL; item->prev = NULL;
item->next = NULL; item->next = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment