{
DEBUG2("rlm_sql_iodbc: Socket destructor called, closing socket");
- if (conn->stmt) {
- SQLFreeStmt(conn->stmt, SQL_DROP);
- }
+ if (conn->stmt) SQLFreeStmt(conn->stmt, SQL_DROP);
if (conn->dbc_handle) {
SQLDisconnect(conn->dbc_handle);
SQLFreeConnect(conn->dbc_handle);
}
- if (conn->env_handle) {
- SQLFreeEnv(conn->env_handle);
- }
+ if (conn->env_handle) SQLFreeEnv(conn->env_handle);
return 0;
}
handle->row = NULL;
- if((rc = SQLFetch(conn->stmt)) == SQL_NO_DATA_FOUND) {
- return 0;
- }
+ rc = SQLFetch(conn->stmt);
+ if (rc == SQL_NO_DATA_FOUND) return RLM_SQL_NO_MORE_ROWS;
+
/* XXX Check rc for database down, if so, return RLM_SQL_RECONNECT */
handle->row = conn->row;