]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CID #1453696 - Check return codes when checking timer events
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 15 Sep 2019 19:04:35 +0000 (14:04 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 15 Sep 2019 19:17:15 +0000 (14:17 -0500)
src/lib/server/connection.c

index 4b9e8e41f60f462c88c4e6d06277a3f8c1c72985..537026c64af85d8e9d56336c418d2192926c8e68 100644 (file)
@@ -162,8 +162,11 @@ static void connection_state_failed(fr_connection_t *conn, fr_time_t now)
        case FR_CONNECTION_STATE_CONNECTED:                     /* Failed after connecting */
        case FR_CONNECTION_STATE_CONNECTING:                    /* Failed during connecting */
                STATE_TRANSITION(FR_CONNECTION_STATE_FAILED);
-               fr_event_timer_at(conn, conn->el, &conn->reconnection_timer,
-                                 now + conn->reconnection_delay, _reconnect_delay_done, conn);
+               if (fr_event_timer_at(conn, conn->el, &conn->reconnection_timer,
+                                     now + conn->reconnection_delay, _reconnect_delay_done, conn) < 0) {
+                       PERROR("Failed inserting delay timer event");
+                       rad_assert(0);
+               }
                break;
 
        case FR_CONNECTION_STATE_TIMEOUT:                       /* Failed during connecting */
@@ -314,9 +317,12 @@ static void connection_state_init(fr_connection_t *conn, fr_time_t now)
                 *      set, then add the timer.
                 */
                if (conn->connection_timeout) {
-                       fr_event_timer_at(conn, conn->el, &conn->connection_timer,
-                                         now + conn->connection_timeout,
-                                         _connection_timeout, conn);
+                       if (fr_event_timer_at(conn, conn->el, &conn->connection_timer,
+                                             now + conn->connection_timeout,
+                                             _connection_timeout, conn) < 0) {
+                               PERROR("Failed inserting connection timeout event");
+                               rad_assert(0);
+                       }
                }
                break;