diff options
-rw-r--r-- | lib/tevent/tevent_poll.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c index f63173744f..7d10665353 100644 --- a/lib/tevent/tevent_poll.c +++ b/lib/tevent/tevent_poll.c @@ -297,11 +297,17 @@ static struct tevent_fd *poll_event_add_fd(struct tevent_context *ev, */ static void poll_event_set_fd_flags(struct tevent_fd *fde, uint16_t flags) { - struct poll_event_context *poll_ev = talloc_get_type_abort( - fde->event_ctx->additional_data, struct poll_event_context); + struct tevent_context *ev = fde->event_ctx; + struct poll_event_context *poll_ev; uint64_t idx = fde->additional_flags; uint16_t pollflags; + if (ev == NULL) { + return; + } + poll_ev = talloc_get_type_abort( + ev->additional_data, struct poll_event_context); + fde->flags = flags; if (idx == UINT64_MAX) { |