When calling DLIST_REMOVE(x,x) (from lib/interface.c) ensure that the pointer
authorJeremy Allison <jra@samba.org>
Tue, 20 Mar 2001 23:29:36 +0000 (23:29 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 20 Mar 2001 23:29:36 +0000 (23:29 +0000)
is still valid before setting prev and next to null.
Jeremy.

source/include/dlinklist.h

index c35155d9bc7e3596cd04dc486c5e4e31035fe277..e68f2a4d861c72f8ac18707f200cad04bd3d6927 100644 (file)
@@ -47,7 +47,7 @@
                if ((p)->prev) (p)->prev->next = (p)->next; \
                if ((p)->next) (p)->next->prev = (p)->prev; \
        } \
-       (p)->next = (p)->prev = NULL; \
+       if ((p)) (p)->next = (p)->prev = NULL; \
 }
 
 /* promote an element to the top of the list */