numaffected = (inst->module->sql_affected_rows)(handle, inst->config);
if (numaffected < 1) {
RDEBUG("SQL query affected no rows");
+ (inst->driver->sql_finish_query)(handle, inst->config);
goto finish;
}
if (rcode != RLM_SQL_OK) goto query_error;
rcode = rlm_sql_fetch_row(inst, request, &handle);
- if (rcode) goto query_error;
+ if (rcode) {
+ (inst->driver->sql_finish_select_query)(handle, inst->config);
+ goto query_error;
+ }
row = handle->row;
if (!row) {
fr_pair_value_strsteal(vp, expanded);
RDEBUG2("SQL-User-Name set to '%s'", vp->vp_strvalue);
- vp->op = T_OP_SET;
+ vp->op = T_OP_SET;
/*
* Delete any existing SQL-User-Name, and replace it with ours.