mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
src: resolve issues reported by coverity
The specific issues raised by Coverity are: ** CID 182716: Control flow issues (DEADCODE) /src/node_file.cc: 1192 >>> CID 182716: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "args->GetReturnValue().Set(...". ** CID 182715: Uninitialized members (UNINIT_CTOR) /src/node_file.h: 29 >>> CID 182715: Uninitialized members (UNINIT_CTOR) >>> Non-static class member "syscall_" is not initialized in this constructor nor in any functions that it calls. PR-URL: https://github.com/nodejs/node/pull/18629 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
1729af2ce9
commit
28708677d9
@ -1192,13 +1192,9 @@ static void OpenFileHandle(const FunctionCallbackInfo<Value>& args) {
|
||||
req_wrap->SetReturnValue(args);
|
||||
} else {
|
||||
SYNC_CALL(open, *path, *path, flags, mode)
|
||||
if (SYNC_RESULT < 0) {
|
||||
args.GetReturnValue().Set(SYNC_RESULT);
|
||||
} else {
|
||||
HandleScope scope(env->isolate());
|
||||
FileHandle* fd = new FileHandle(env, SYNC_RESULT);
|
||||
args.GetReturnValue().Set(fd->object());
|
||||
}
|
||||
HandleScope scope(env->isolate());
|
||||
FileHandle* fd = new FileHandle(env, SYNC_RESULT);
|
||||
args.GetReturnValue().Set(fd->object());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ class FSReqBase : public ReqWrap<uv_fs_t> {
|
||||
|
||||
private:
|
||||
enum encoding encoding_ = UTF8;
|
||||
const char* syscall_;
|
||||
const char* syscall_ = nullptr;
|
||||
|
||||
const char* data_ = nullptr;
|
||||
MaybeStackBuffer<char> buffer_;
|
||||
|
Loading…
Reference in New Issue
Block a user