kernel/util: Clear list links on removal under KDEBUG.
This way, if someone tries to double-remove an item or do other invalid things to it, this will crash instead of (silently) corrupting.
This commit is contained in:
@@ -528,6 +528,10 @@ DOUBLY_LINKED_LIST_CLASS_NAME::Remove(Element* element)
|
||||
sGetLink(elLink->next)->previous = elLink->previous;
|
||||
else
|
||||
fLast = elLink->previous;
|
||||
|
||||
#if DEBUG_DOUBLY_LINKED_LIST
|
||||
elLink->next = elLink->previous = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user