summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_timed.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tevent/tevent_timed.c')
-rw-r--r--lib/tevent/tevent_timed.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tevent/tevent_timed.c b/lib/tevent/tevent_timed.c
index dadd360416..78c8a24511 100644
--- a/lib/tevent/tevent_timed.c
+++ b/lib/tevent/tevent_timed.c
@@ -108,9 +108,9 @@ bool ev_timeval_is_zero(const struct timeval *tv)
*/
static int tevent_common_timed_destructor(struct tevent_timer *te)
{
- struct tevent_context *ev = talloc_get_type(te->event_ctx,
- struct tevent_context);
- DLIST_REMOVE(ev->timer_events, te);
+ if (te->event_ctx) {
+ DLIST_REMOVE(te->event_ctx->timer_events, te);
+ }
return 0;
}