]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Virtual servers should be freed and unloaded before modules Closes #5062
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 14 Jun 2023 22:11:01 +0000 (18:11 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 14 Jun 2023 22:11:01 +0000 (18:11 -0400)
src/bin/radiusd.c
src/bin/unit_test_module.c

index 1c5a1768b72d313261cfd8c0bfafe9ed87873ae5..d64254710c28f9229111dcc381ca4e27a6839c1b 100644 (file)
@@ -1104,6 +1104,13 @@ cleanup:
 
        if (config) talloc_memory_report = config->talloc_memory_report;        /* Grab this before we free the config */
 
+       /*
+        *      Virtual servers need to be freed before modules
+        *      as state entries containing data with module-specific
+        *      destructors may exist.
+        */
+       virtual_servers_free();
+
        /*
         *      Free modules, this needs to be done explicitly
         *      because some libraries used by modules use atexit
@@ -1113,11 +1120,6 @@ cleanup:
         */
        modules_rlm_free();
 
-       /*
-        *      Same with virtual servers and proto modules.
-        */
-       virtual_servers_free();
-
        /*
         *  And now nothing should be left anywhere except the
         *  parsed configuration items.
index 6e2d9de3ea79c408cb969e66ffbdae28e27bdec4..8873bc8ac746d7faed7cc24072615b096959c3ac 100644 (file)
@@ -1113,6 +1113,13 @@ cleanup:
         */
        unlang_free_global();
 
+       /*
+        *      Virtual servers need to be freed before modules
+        *      as state entries containing data with module-specific
+        *      destructors may exist.
+        */
+       virtual_servers_free();
+
        /*
         *      Free modules, this needs to be done explicitly
         *      because some libraries used by modules use atexit
@@ -1122,11 +1129,6 @@ cleanup:
         */
        modules_rlm_free();
 
-       /*
-        *      Same with virtual servers and proto modules.
-        */
-       virtual_servers_free();
-
        /*
         *      And now nothing should be left anywhere except the
         *      parsed configuration items.