From 62aa1ea5d70968e7a3c8985b9671ba0192cc5f0d Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Thu, 11 Feb 2016 15:22:00 +0200 Subject: [PATCH] Remove module to be freed from list. When a module is unregistered, it must be removed from the list. Otherwise, if explicit unregistering of a module is made, there will be a crash at shutdown when all modules are unregistered. --- server/core/load_utils.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/core/load_utils.c b/server/core/load_utils.c index 4b0160ce3..5fdaad1f8 100644 --- a/server/core/load_utils.c +++ b/server/core/load_utils.c @@ -351,6 +351,14 @@ unregister_module(const char *module) { ptr = ptr->next; } + + /*< + * Remove the module to be be freed from the list. + */ + if (ptr && (ptr->next == mod)) + { + ptr->next = ptr->next->next; + } } /*<