]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allocate instance data even if the module doesn't need it
authorAlan T. DeKok <aland@freeradius.org>
Sat, 18 May 2024 20:50:56 +0000 (16:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 18 May 2024 22:43:08 +0000 (18:43 -0400)
which lets the rest of the distinguish virtual attributes from
typos in xlat functions

src/main/modules.c

index fd4334db96e213beee068d9dcac00e4c6ed4a978..9ccb3103ae0a129b258c2e8c84e92b033144a46f 100644 (file)
@@ -571,10 +571,10 @@ static int module_conf_parse(module_instance_t *node, void **handle)
         *      If there is supposed to be instance data, allocate it now.
         *      Also parse the configuration data, if required.
         */
-       if (node->entry->module->inst_size) {
-               *handle = talloc_zero_array(node, uint8_t, node->entry->module->inst_size);
-               rad_assert(*handle);
+       *handle = talloc_zero_array(node, uint8_t, node->entry->module->inst_size);
+       rad_assert(*handle);
 
+       if (node->entry->module->inst_size) {
                talloc_set_name(*handle, "rlm_%s_t",
                                node->entry->module->name ? node->entry->module->name : "config");