]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Better error handling on reading dynamic clients at startup
authorNick Porter <nick@portercomputing.co.uk>
Thu, 18 Jul 2024 17:22:11 +0000 (18:22 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 18 Jul 2024 17:22:11 +0000 (18:22 +0100)
src/main/realms.c

index e2663b566a6c16c0d2f814fdc5631c82120dabea..eca8f690fe0e3d60a8de4b6828e18c60433c0d64 100644 (file)
@@ -2504,6 +2504,11 @@ int realms_init(CONF_SECTION *config)
             cs = cf_subsection_find_next(config, cs, "realm")) {
                if (!realm_add(rc, cs)) {
                error:
+                       /*
+                        *      realm_config is freed by realms_free()
+                        *      so if rc == realm_config set it to NULL here.
+                        */
+                       if (rc == realm_config) rc = NULL;
                        realms_free();
                        /*
                         *      Must be called after realms_free as home_servers