tevent_poll: NULL out fde->event_ctx for "fresh" poll fdes
authorVolker Lendecke <vl@samba.org>
Thu, 31 Jan 2013 15:31:45 +0000 (16:31 +0100)
committerJeremy Allison <jra@samba.org>
Sun, 3 Feb 2013 03:52:57 +0000 (19:52 -0800)
This is done in tevent_common_context_destructor for the non-fresh
fdes already

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/tevent/tevent_poll.c

index f64dd386f97e543a974f76dae15f847de981c5b5..0c580e49eec081ac842d10688cd80464cae61800 100644 (file)
@@ -57,6 +57,14 @@ struct poll_event_context {
 
 static int poll_event_context_destructor(struct poll_event_context *poll_ev)
 {
+       struct tevent_fd *fd, *fn;
+
+       for (fd = poll_ev->fresh; fd; fd = fn) {
+               fn = fd->next;
+               fd->event_ctx = NULL;
+               DLIST_REMOVE(poll_ev->fresh, fd);
+       }
+
        if (poll_ev->signal_fd == -1) {
                /*
                 * Non-threaded, no signal pipe