Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
src: fix some recently introduced coverity issues
Signed-off-by: Michael Dawson <mdawson@devrus.com>
  • Loading branch information
mhdawson committed Mar 23, 2023
commit 3ae2db286ec0c6e095e166c3efd95929ff7f51ac
4 changes: 2 additions & 2 deletions src/dataqueue/queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ class FdEntry final : public EntryImpl {
public:
static std::unique_ptr<FdEntry> Create(Environment* env, Local<Value> path) {
// We're only going to create the FdEntry if the file exists.
uv_fs_t req;
uv_fs_t req = {0};
auto cleanup = OnScopeLeave([&] { uv_fs_req_cleanup(&req); });

auto buf = std::make_shared<BufferValue>(env->isolate(), path);
Expand Down Expand Up @@ -849,7 +849,7 @@ class FdEntry final : public EntryImpl {
}

static bool CheckModified(FdEntry* entry, int fd) {
uv_fs_t req;
uv_fs_t req = {0};
auto cleanup = OnScopeLeave([&] { uv_fs_req_cleanup(&req); });
// TODO(jasnell): Note the use of a sync fs call here is a bit unfortunate.
// Doing this asynchronously creates a bit of a race condition tho, a file
Expand Down
2 changes: 1 addition & 1 deletion test/embedding/embedtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform,
if (snapshot_as_file_it != args.end()) {
snapshot = node::EmbedderSnapshotData::FromFile(fp);
} else {
uv_fs_t req;
uv_fs_t req = {0};
int statret = uv_fs_stat(nullptr, &req, filename, nullptr);
assert(statret == 0);
size_t filesize = req.statbuf.st_size;
Expand Down