Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: fix some recently introduced coverity issues #47240

Closed
wants to merge 3 commits into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dataqueue/queue.cc
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
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