From: Alan T. DeKok Date: Tue, 14 Jul 2026 02:26:25 +0000 (-0400) Subject: delay check for virtual server until we need to dereference it X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=028ef03668df3fd2dd55e656752afb79fcd52d4b;p=thirdparty%2Ffreeradius-server.git delay check for virtual server until we need to dereference it --- diff --git a/src/lib/server/module_rlm.c b/src/lib/server/module_rlm.c index c61c940cae4..195a83b190f 100644 --- a/src/lib/server/module_rlm.c +++ b/src/lib/server/module_rlm.c @@ -751,8 +751,6 @@ fr_slen_t module_rlm_by_name_and_method(TALLOC_CTX *ctx, module_method_call_t *m } by_section: - if (!vs) goto section_error; - /* * First look for the section name in the module's * bindings. If that fails, look for the alt @@ -762,7 +760,11 @@ by_section: */ mmb = module_binding_find(&mmc->rlm->method_group, section); if (!mmb) { - section_name_t const **alt_p = virtual_server_section_methods(vs, section); + section_name_t const **alt_p; + + if (!vs) goto section_error; + + alt_p = virtual_server_section_methods(vs, section); if (alt_p) { for (; *alt_p; alt_p++) { mmb = module_binding_find(&mmc->rlm->method_group, *alt_p);