diff options
author | Eugene Ostroukhov <eostroukhov@chromium.org> | 2017-04-07 18:44:18 +0300 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@chromium.org> | 2017-04-12 01:58:05 +0300 |
commit | 42be835e054b46bb3b3cfb0683ca51cb86b5f1f7 (patch) | |
tree | 29340ac08fd8329c4099816123302934210b1df3 /src/inspector_io.cc | |
parent | b8f416023d61c73c571f15bc967d6ec630e3215f (diff) |
inspector: fix Coverity defects
PR-URL: https://github.com/nodejs/node/pull/12272
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/inspector_io.cc')
-rw-r--r-- | src/inspector_io.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/inspector_io.cc b/src/inspector_io.cc index dfb119e996c..613e2f70c25 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -155,7 +155,7 @@ class DispatchOnInspectorBackendTask : public v8::Task { InspectorIo::InspectorIo(Environment* env, v8::Platform* platform, const std::string& path, const DebugOptions& options) - : options_(options), delegate_(nullptr), + : options_(options), thread_(), delegate_(nullptr), shutting_down_(false), state_(State::kNew), parent_env_(env), io_thread_req_(), platform_(platform), dispatching_messages_(false), @@ -236,6 +236,7 @@ void InspectorIo::WriteCbIO(uv_async_t* async) { template<typename Transport> void InspectorIo::WorkerRunIO() { uv_loop_t loop; + loop.data = nullptr; int err = uv_loop_init(&loop); CHECK_EQ(err, 0); io_thread_req_.data = nullptr; @@ -244,8 +245,11 @@ void InspectorIo::WorkerRunIO() { std::string script_path; if (!script_name_.empty()) { uv_fs_t req; - if (0 == uv_fs_realpath(&loop, &req, script_name_.c_str(), nullptr)) + req.ptr = nullptr; + if (0 == uv_fs_realpath(&loop, &req, script_name_.c_str(), nullptr)) { + CHECK_NE(req.ptr, nullptr); script_path = std::string(static_cast<char*>(req.ptr)); + } uv_fs_req_cleanup(&req); } InspectorIoDelegate delegate(this, script_path, script_name_, |