From: Stefan Metzmacher Date: Mon, 5 Jan 2009 18:22:22 +0000 (+0100) Subject: tevent: don't crash if te->event_ctx is NULL X-Git-Tag: samba-4.0.0alpha6~275 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e240ca5bdd7e344ecce127997b67ca0a521e3ed8;p=thirdparty%2Fsamba.git tevent: don't crash if te->event_ctx is NULL metze --- diff --git a/lib/tevent/tevent_timed.c b/lib/tevent/tevent_timed.c index dadd3604164..78c8a24511a 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; }