]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
eloop: Fix timeout handler to use local copy of func pointer
authorJouni Malinen <j@w1.fi>
Sat, 26 Dec 2009 12:30:50 +0000 (14:30 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 26 Dec 2009 12:30:50 +0000 (14:30 +0200)
We need to copy not only the context pointers, but also the function
pointer before the timeout gets freed.

src/utils/eloop.c

index 0f239ebb67dbc972e21e1594b29953359936c879..81843c2540f9934b5dc50fa15ca02695cb79af01 100644 (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);
                        }
 
                }