Skip to content

Commit d0a5e7e

Browse files
mhdawsonRafaelGSS
authored andcommitted
src: fix some recently introduced coverity issues
Signed-off-by: Michael Dawson <[email protected]> PR-URL: #47240 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent bd4697a commit d0a5e7e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/dataqueue/queue.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ class FdEntry final : public EntryImpl {
787787
public:
788788
static std::unique_ptr<FdEntry> Create(Environment* env, Local<Value> path) {
789789
// We're only going to create the FdEntry if the file exists.
790-
uv_fs_t req;
790+
uv_fs_t req = uv_fs_t();
791791
auto cleanup = OnScopeLeave([&] { uv_fs_req_cleanup(&req); });
792792

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

851851
static bool CheckModified(FdEntry* entry, int fd) {
852-
uv_fs_t req;
852+
uv_fs_t req = uv_fs_t();
853853
auto cleanup = OnScopeLeave([&] { uv_fs_req_cleanup(&req); });
854854
// TODO(jasnell): Note the use of a sync fs call here is a bit unfortunate.
855855
// Doing this asynchronously creates a bit of a race condition tho, a file

test/embedding/embedtest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform,
7575
if (snapshot_as_file_it != args.end()) {
7676
snapshot = node::EmbedderSnapshotData::FromFile(fp);
7777
} else {
78-
uv_fs_t req;
78+
uv_fs_t req = uv_fs_t();
7979
int statret = uv_fs_stat(nullptr, &req, filename, nullptr);
8080
assert(statret == 0);
8181
size_t filesize = req.statbuf.st_size;

0 commit comments

Comments
 (0)