mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
tevent_poll: Avoid a crash in poll_fresh_fde_destructor
The event context might have been freed before the fde Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
0cf62a92f2
commit
611fcca641
@ -218,8 +218,15 @@ done:
|
||||
|
||||
static int poll_fresh_fde_destructor(struct tevent_fd *fde)
|
||||
{
|
||||
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;
|
||||
|
||||
if (ev == NULL) {
|
||||
return 0;
|
||||
}
|
||||
poll_ev = talloc_get_type_abort(
|
||||
ev->additional_data, struct poll_event_context);
|
||||
|
||||
DLIST_REMOVE(poll_ev->fresh, fde);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user