From: Arran Cudbard-Bell Date: Sun, 12 May 2024 16:53:36 +0000 (-0600) Subject: Tweak to process virtual server sections before calling the instantiate function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef4d71cfc7d4915f2768a957d834cfc569a1b717;p=thirdparty%2Ffreeradius-server.git Tweak to process virtual server sections before calling the instantiate function --- diff --git a/src/lib/server/virtual_servers.c b/src/lib/server/virtual_servers.c index 97b3cc18649..3f8d3f44228 100644 --- a/src/lib/server/virtual_servers.c +++ b/src/lib/server/virtual_servers.c @@ -1465,18 +1465,11 @@ int virtual_servers_instantiate(void) fr_assert(virtual_servers[i]->process_mi); - /* - * Complete final instantiation of the process module - */ - if (module_instantiate(virtual_servers[i]->process_mi) < 0) { - cf_log_perr(virtual_servers[i]->process_mi->conf, - "Failed instantiating process module"); - return -1; - } - /* * Compile the processing sections indicated by - * the process module. + * the process module. This must be done before + * module_instantiate is called, as the instance + * data is protected after this call. */ if (process->compile_list) { tmpl_rules_t parse_rules = { @@ -1494,6 +1487,15 @@ int virtual_servers_instantiate(void) } } + /* + * Complete final instantiation of the process module + */ + if (module_instantiate(virtual_servers[i]->process_mi) < 0) { + cf_log_perr(virtual_servers[i]->process_mi->conf, + "Failed instantiating process module"); + return -1; + } + /* * Print out warnings for unused "recv" and * "send" sections.