Skip to content

Commit

Permalink
inspector: fix Coverity defects
Browse files Browse the repository at this point in the history
PR-URL: #12272
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
Eugene Ostroukhov committed Apr 11, 2017
1 parent b8f4160 commit 42be835
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/inspector_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;
Expand All @@ -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_,
Expand Down

0 comments on commit 42be835

Please sign in to comment.