From: Jouni Malinen Date: Sat, 26 Dec 2009 12:30:50 +0000 (+0200) Subject: eloop: Fix timeout handler to use local copy of func pointer X-Git-Tag: hostap_0_7_1~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=459489c99d25c4ceca2b89ed32fceabeb020bb55;p=thirdparty%2Fhostap.git 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. --- diff --git a/src/utils/eloop.c b/src/utils/eloop.c index 0f239ebb6..81843c254 100644 --- a/src/utils/eloop.c +++ b/src/utils/eloop.c @@ -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); } }