Fix use of DLIST_REMOVE as spotted by Constantine Vetoshev <gepardcv@gmail.com>.
commit979a104ce34ca294e41185cfa572c0d89791944e
authorJeremy Allison <jra@samba.org>
Wed, 1 Oct 2008 20:23:09 +0000 (1 13:23 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 2 Oct 2008 06:23:25 +0000 (2 08:23 +0200)
treeadaa774cf01ade478b6f4104e3837bf202c9a993
parent5c75c5cc294be58a293073e4bb88733ad8b270d4
Fix use of DLIST_REMOVE as spotted by Constantine Vetoshev <gepardcv@gmail.com>.
This API is unusual in that if used to remove a non-list head it nulls out
the next and prev pointers. This is what you want for debugging (don't want
an entry removed from the list to be still virtually linked into it) but
means there is no consistent idiom for use as the next and prev pointers
get trashed on removal from the list, meaning you must save them yourself.
You can use it one way when deleting everything via the head pointer, as
this preserves the next pointer, but you *must* use it another way when not
deleting everything via the head pointer. Fix all known uses of this (the main
one is in conn_free_internal() and would not free all the private data entries
for vfs modules. The other changes in web/statuspage.c and winbindd_util.c
are not strictly neccessary, as the head pointer is being used, but I've done
them for consistency. Long term we must revisit this as this API is too hard
to use correctly.
Jeremy.
(cherry picked from commit 737825183115732de1f1d6d2bd89ce6402a65b20)
source/smbd/conn.c
source/web/statuspage.c
source/winbindd/winbindd_util.c