From deb839e18f64fedaa8e789ee6bd8619de957ea65 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 20 May 2007 22:59:21 +0200 Subject: [PATCH] plugin.c: Advance the llentry_t pointer before calling the shutdown callback. > Important note: Unregistering the shutdown callback during shutdown is > somewhat tricky. Doing that frees the llist_t entry in plugin.c:list_shutdown. > This might cause a segfault in plugin_shutdown_all () when it tries to access > the next pointer of that entry. If plugin_unregister_shutdown () is the last > statement before the return from the shutdown callback this should be save in > about 99% of all cases. Still there should be some better way to handle this. This is an imho nice way to fix it. Signed-off-by: Sebastian Harl --- src/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 36cd80af..8087950e 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -607,9 +607,9 @@ void plugin_shutdown_all (void) while (le != NULL) { callback = (int (*) (void)) le->value; - (*callback) (); - le = le->next; + + (*callback) (); } } /* void plugin_shutdown_all */ -- 2.11.0