]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only standard modules register xlats with their own name developer/ndptech master
authorNick Porter <nick@portercomputing.co.uk>
Thu, 9 Apr 2026 13:05:43 +0000 (14:05 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 9 Apr 2026 14:13:11 +0000 (15:13 +0100)
Without this, if a virtual server, for example, has the same name as a
module which registers an xlat in its name, then, during server
shutdown, removing the process module for the virtual server attempts to
unregister the xlat which it doesn't own and leads to a seg fault.

src/lib/server/module.c

index 47bbb3212dea492356baeaa612841119e44ecdff..edaa452e558b9cf6fd0f8ba8005546d1eb09f12d 100644 (file)
@@ -1533,7 +1533,7 @@ static int _module_instance_free(module_instance_t *mi)
         *      Remove all xlat's registered to module instance.
         */
        if (mi->data) {
-               xlat_func_unregister(mi->name);
+               if (mi->module->type == DL_MODULE_TYPE_MODULE) xlat_func_unregister(mi->name);
                xlat_func_unregister_module(mi);
        }