summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-21 23:50:26 +0000
committerJeremy Allison <jra@samba.org>2001-03-21 23:50:26 +0000
commitb8feb83cd62171dd5d6163d5a14edf7fedfd3b30 (patch)
tree50c04110f388732ef5db988fea8f0fac74fa9363
parent90890ef9fc2e0e1de389f6bc8137f7db7c8f9621 (diff)
downloadsamba-b8feb83cd62171dd5d6163d5a14edf7fedfd3b30.tar.gz
samba-b8feb83cd62171dd5d6163d5a14edf7fedfd3b30.tar.bz2
samba-b8feb83cd62171dd5d6163d5a14edf7fedfd3b30.zip
Fix memory leak when doing DLIST_REMOVE(head,head).
Jeremy. (This used to be commit 4fd8afaf573054eaa838398f62918757659c2c21)
-rw-r--r--source3/include/dlinklist.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/include/dlinklist.h b/source3/include/dlinklist.h
index e68f2a4d86..cf75404c56 100644
--- a/source3/include/dlinklist.h
+++ b/source3/include/dlinklist.h
@@ -47,7 +47,7 @@
if ((p)->prev) (p)->prev->next = (p)->next; \
if ((p)->next) (p)->next->prev = (p)->prev; \
} \
- if ((p)) (p)->next = (p)->prev = NULL; \
+ if ((p) && ((p) != (list))) (p)->next = (p)->prev = NULL; \
}
/* promote an element to the top of the list */