]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
print error and fail if registration fails
authorAlan T. DeKok <aland@freeradius.org>
Wed, 23 Aug 2023 14:19:24 +0000 (10:19 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 23 Aug 2023 14:19:24 +0000 (10:19 -0400)
src/modules/rlm_sql/rlm_sql.c

index 847d77373d68b05424e88e0b561d38f31fdc67a9..bd5b51ef4e480117bcb1e17e90dd60e9dc4bb0ac 100644 (file)
@@ -1122,6 +1122,10 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
                 *      Define the new %{sql.group:name} xlat
                 */
                xlat = xlat_func_register_module(inst, mctx, group_attribute, sql_group_xlat, FR_TYPE_BOOL);
+               if (!xlat) {
+                       PERROR("Failed registering %s expansion", group_attribute);
+                       return -1;
+               }
 
                /*
                 *      The xlat escape function needs access to inst - so
@@ -1142,6 +1146,10 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
         *      Register the SQL xlat function
         */
        xlat = xlat_func_register_module(inst, mctx, mctx->inst->name, sql_xlat, FR_TYPE_VOID); /* Returns an integer sometimes */
+       if (!xlat) {
+               PERROR("Failed registering %s expansion", mctx->inst->name);
+               return -1;
+       }
 
        /*
         *      The xlat escape function needs access to inst - so