]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
delay check for virtual server until we need to dereference it
authorAlan T. DeKok <aland@freeradius.org>
Tue, 14 Jul 2026 02:26:25 +0000 (22:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 14 Jul 2026 02:28:05 +0000 (22:28 -0400)
src/lib/server/module_rlm.c

index c61c940cae4c5dd799b26723b45bdf77a2680678..195a83b190ff5c0846e60afec1ba96d1566ee558 100644 (file)
@@ -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);