From: Arran Cudbard-Bell Date: Sun, 15 Sep 2019 19:04:35 +0000 (-0500) Subject: CID #1453696 - Check return codes when checking timer events X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f4d84fbf2db5246a1c024b0d3314364602f56ea;p=thirdparty%2Ffreeradius-server.git CID #1453696 - Check return codes when checking timer events --- diff --git a/src/lib/server/connection.c b/src/lib/server/connection.c index 4b9e8e41f60..537026c64af 100644 --- a/src/lib/server/connection.c +++ b/src/lib/server/connection.c @@ -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;