From b8feb83cd62171dd5d6163d5a14edf7fedfd3b30 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Mar 2001 23:50:26 +0000 Subject: Fix memory leak when doing DLIST_REMOVE(head,head). Jeremy. (This used to be commit 4fd8afaf573054eaa838398f62918757659c2c21) --- source3/include/dlinklist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') 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 */ -- cgit