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 <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/43254
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Michael Dawson authored and Danielle Adams committed 2022-06-15 21:28:45 -04:00
1 parent 066f963ec1
commit d2a98dc6cf
1 file changed
+1 -1
+1 -1
View File
@@ -31,7 +31,7 @@ class TracingAgent : public NodeTracing::Backend {
Environment* env_;
std::shared_ptr<MainThreadHandle> main_thread_;
tracing::AgentWriterHandle trace_writer_;
int frontend_object_id_;
int frontend_object_id_ = 0;
std::shared_ptr<NodeTracing::Frontend> frontend_;
};