From: Volker Lendecke Date: Thu, 31 Jan 2013 15:31:45 +0000 (+0100) Subject: tevent_poll: NULL out fde->event_ctx for "fresh" poll fdes X-Git-Tag: tevent-0.9.18~345 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0cf62a92f26ef9c7d3c5a5d256adc72d66335319;p=thirdparty%2Fsamba.git tevent_poll: NULL out fde->event_ctx for "fresh" poll fdes This is done in tevent_common_context_destructor for the non-fresh fdes already Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c index f64dd386f97..0c580e49eec 100644 --- a/lib/tevent/tevent_poll.c +++ b/lib/tevent/tevent_poll.c @@ -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