From d2a98dc6cfcc4ee5193774064c62b2a1604e33c9 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 30 May 2022 14:48:14 -0400 Subject: [PATCH] inspector: add missing initialization Add missing initialization reported by coverity. With proper usage it looks like it will be initialized but still good to have it initialized to a known state in case that changes or invalide usage. The method used to create object ids newObjectId() starts at 1 so initializing to 0 should be safe and what we get now when compiled in a way that auto initializes (for example debug) Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/43254 Reviewed-By: Darshan Sen Reviewed-By: Minwoo Jung Reviewed-By: Luigi Pinca --- src/inspector/tracing_agent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inspector/tracing_agent.h b/src/inspector/tracing_agent.h index e23d2fadae9354..b8274de2be9bc6 100644 --- a/src/inspector/tracing_agent.h +++ b/src/inspector/tracing_agent.h @@ -31,7 +31,7 @@ class TracingAgent : public NodeTracing::Backend { Environment* env_; std::shared_ptr main_thread_; tracing::AgentWriterHandle trace_writer_; - int frontend_object_id_; + int frontend_object_id_ = 0; std::shared_ptr frontend_; };