clist: corrupt removed entry pointers if DEBUG
This commit is contained in:
parent
3f73072153
commit
7c4819e5fd
1 changed files with 6 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
/* See the end of this file for copyright and license terms. */
|
||||
|
||||
#include <gay/clist.h>
|
||||
#include <gay/config.h>
|
||||
|
||||
void clist_init(struct clist *head)
|
||||
{
|
||||
|
@ -30,6 +31,11 @@ void clist_del(struct clist *node)
|
|||
{
|
||||
node->next->prev = node->prev;
|
||||
node->prev->next = node->next;
|
||||
|
||||
# ifdef DEBUG
|
||||
node->next = NULL;
|
||||
node->prev = NULL;
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue