summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-05 19:22:22 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-05 22:44:54 +0100
commite240ca5bdd7e344ecce127997b67ca0a521e3ed8 (patch)
tree51c4913bc515c828b04c6801f3b830bdfd7ab1b2
parentceac26008c6f36602259d0180f1e7f7a756ea4ad (diff)
downloadsamba-e240ca5bdd7e344ecce127997b67ca0a521e3ed8.tar.gz
samba-e240ca5bdd7e344ecce127997b67ca0a521e3ed8.tar.bz2
samba-e240ca5bdd7e344ecce127997b67ca0a521e3ed8.zip
tevent: don't crash if te->event_ctx is NULL
metze
-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;
}