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:
parent
833fe95eb1
commit
459489c99d
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue