From: Alan T. DeKok Date: Wed, 29 Mar 2023 11:31:02 +0000 (+0900) Subject: try to shut up clang scan X-Git-Tag: release_3_2_3~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=264d6bf2e4f6d9e5349beb7b8fc76e267f329fa8;p=thirdparty%2Ffreeradius-server.git try to shut up clang scan which assumes (a) this->type == DETAIL, followed by assuming that (b) this->type != DETAIL So it's not tracking things correctly as the listener isn't being changed during all that. --- diff --git a/src/main/process.c b/src/main/process.c index 35c6d9e786..8902386460 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -5413,7 +5413,7 @@ static int proxy_eol_cb(void *ctx, void *data) static void event_new_fd(rad_listen_t *this) { char buffer[1024]; - listen_socket_t *sock; + listen_socket_t *sock = NULL; ASSERT_MASTER; @@ -5424,6 +5424,8 @@ static void event_new_fd(rad_listen_t *this) if (this->type != RAD_LISTEN_DETAIL) { sock = this->data; rad_assert(sock != NULL); + } else { + rad_assert(!this->send_coa); } if (this->status == RAD_LISTEN_STATUS_INIT) { @@ -5473,6 +5475,7 @@ static void event_new_fd(rad_listen_t *this) */ case RAD_LISTEN_PROXY: #ifdef WITH_TCP + rad_assert(sock != NULL); rad_assert((sock->proto == IPPROTO_UDP) || (sock->home != NULL)); /* @@ -5742,6 +5745,7 @@ static void event_new_fd(rad_listen_t *this) #endif ) { home_server_t *home; + sock = this->data; home = sock->home; if (!home || !home->limit.max_connections) { @@ -5803,8 +5807,7 @@ static void event_new_fd(rad_listen_t *this) if (!spawn_flag) { ASSERT_MASTER; - if (this->type != RAD_LISTEN_DETAIL && sock->ev) { - sock = this->data; + if (this->type != RAD_LISTEN_DETAIL && sock && sock->ev) { fr_event_delete(el, &sock->ev); } listen_free(&this);