eloop: Fix timeout handler to use local copy of func pointer

We need to copy not only the context pointers, but also the function
pointer before the timeout gets freed.
This commit is contained in:
Jouni Malinen 2009-12-26 14:30:50 +02:00
parent 833fe95eb1
commit 459489c99d

View file

@ -534,9 +534,10 @@ void eloop_run(void)
if (!os_time_before(&now, &timeout->time)) {
void *eloop_data = timeout->eloop_data;
void *user_data = timeout->user_data;
eloop_timeout_handler handler =
timeout->handler;
eloop_remove_timeout(timeout);
timeout->handler(eloop_data,
user_data);
handler(eloop_data, user_data);
}
}