Typo
[freeradius.git] / src / modules / rlm_sql / drivers / rlm_sql_iodbc / rlm_sql_iodbc.c
index 61d2086..4a4ae5c 100644 (file)
@@ -58,18 +58,14 @@ static int _sql_socket_destructor(rlm_sql_iodbc_conn_t *conn)
 {
        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;
 }
@@ -244,9 +240,9 @@ static sql_rcode_t sql_fetch_row(rlm_sql_handle_t *handle, UNUSED rlm_sql_config
 
        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;