From: Alan T. DeKok Date: Wed, 23 Aug 2023 14:19:24 +0000 (-0400) Subject: print error and fail if registration fails X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b132f79face6292823cf373a1e9c0776eef889ae;p=thirdparty%2Ffreeradius-server.git print error and fail if registration fails --- diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 847d77373d6..bd5b51ef4e4 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -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