r17861: Fix inconsistency found in checking for NULL in DLIST_REMOVE
authorJeremy Allison <jra@samba.org>
Mon, 28 Aug 2006 01:44:40 +0000 (01:44 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:54 +0000 (11:38 -0500)
macro. Don't check for NULL if we would have already derefed.
Jeremy.
(This used to be commit 1cb379315a45a0c47feab0df1f07ec5d808a4259)

source3/include/dlinklist.h

index c856aaa7625794dc20d2305ec66e4099c502e2e9..daec7640e40e1c7abc8182e9ab772f5ce4390a69 100644 (file)
@@ -46,7 +46,7 @@
                if ((p)->prev) (p)->prev->next = (p)->next; \
                if ((p)->next) (p)->next->prev = (p)->prev; \
        } \
-       if ((p) && ((p) != (list))) (p)->next = (p)->prev = NULL; \
+       if ((p) != (list)) (p)->next = (p)->prev = NULL; \
 }
 
 /* promote an element to the top of the list */