Copilot commented on code in PR #13733: URL: https://github.com/apache/trafficserver/pull/13733#discussion_r4301712594
########## src/traffic_top/traffic_top.cc: ########## @@ -412,6 +433,7 @@ main([[maybe_unused]] int argc, const char **argv) const string &host = stats.getHost(); initscr(); + curses_started = true; Review Comment: The state is marked as started unconditionally even when `initscr()` returns `ERR`/null. In that failure path an exception later in `main` makes `restore_terminal()` call `endwin()` despite the X/Open precondition described above, so the cleanup guard does not actually protect the invalid call. Capture the return value and set `curses_started` only after a successful initialization. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
