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; + } } /*<