mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
src: fix some recently introduced coverity issues
Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/47240 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
bd4697a2a3
commit
d0a5e7e342
2 files changed
+3
-3
No files matched your search
@@ -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 = uv_fs_t();
|
||||
auto cleanup = OnScopeLeave([&] { uv_fs_req_cleanup(&req); });
|
||||
|
||||
auto buf = std::make_shared<BufferValue>(env->isolate(), path);
|
||||
@@ -849,7 +849,7 @@ class FdEntry final : public EntryImpl {
|
||||
}
|
||||
|
||||
static bool CheckModified(FdEntry* entry, int fd) {
|
||||
uv_fs_t req;
|
||||
uv_fs_t req = uv_fs_t();
|
||||
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
|
||||
|
||||
@@ -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 = uv_fs_t();
|
||||
int statret = uv_fs_stat(nullptr, &req, filename, nullptr);
|
||||
assert(statret == 0);
|
||||
size_t filesize = req.statbuf.st_size;
|
||||
|
||||
Reference in new issue
Block a user