From: Nick Porter Date: Thu, 18 Jul 2024 17:22:11 +0000 (+0100) Subject: Better error handling on reading dynamic clients at startup X-Git-Tag: release_3_2_6~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb16a120219945dede34a85cfbe960d2f22fb219;p=thirdparty%2Ffreeradius-server.git Better error handling on reading dynamic clients at startup --- diff --git a/src/main/realms.c b/src/main/realms.c index e2663b566a6..eca8f690fe0 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -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