From 8bd8be2ac2c182c1ca01fc46cd6e080b8b7505a6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 24 Apr 2026 03:41:48 -0500 Subject: [PATCH] [web_server_idf] Add NOLINT at call site for cross-function analyzer path The function-level NOLINTBEGIN/NOLINTEND on start_session_main_loop_() only covers bug paths whose primary or note locations fall inside that function. clang-analyzer now traces the leak through the caller chain (AsyncEventSource::loop -> adopt_pending_sessions_main_loop_ -> start_session_main_loop_ -> ArduinoJson), with notes at lines 497/498 and 530/537 that sit outside the wrapped range. Add a NOLINTNEXTLINE at the call site in adopt_pending_sessions_main_loop_ so the caller's bug-path location is covered too. --- esphome/components/web_server_idf/web_server_idf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/components/web_server_idf/web_server_idf.cpp b/esphome/components/web_server_idf/web_server_idf.cpp index 5abb9db627..a88419a84b 100644 --- a/esphome/components/web_server_idf/web_server_idf.cpp +++ b/esphome/components/web_server_idf/web_server_idf.cpp @@ -534,6 +534,7 @@ void AsyncEventSource::adopt_pending_sessions_main_loop_() { this->sessions_.push_back(rsp); // Prime first so on_connect_ observes a session that has already sent its // initial ping/config/sorting_groups, matching the pre-refactor ordering. + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson rsp->start_session_main_loop_(); if (this->on_connect_) { this->on_connect_(rsp);