Skip to content

Commit

Permalink
src: initialize FSReqWrapSync in path that uses it
Browse files Browse the repository at this point in the history
PR-URL: nodejs#56613
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
targos authored Jan 19, 2025
1 parent 009d53e commit 322056d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2482,7 +2482,6 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
}
} else { // write(fd, string, pos, enc, undefined, ctx)
CHECK_EQ(argc, 6);
FSReqWrapSync req_wrap_sync;
FSReqBase::FSReqBuffer stack_buffer;
if (buf == nullptr) {
if (!StringBytes::StorageSize(isolate, value, enc).To(&len))
Expand All @@ -2496,6 +2495,7 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
buf = *stack_buffer;
}
uv_buf_t uvbuf = uv_buf_init(buf, len);
FSReqWrapSync req_wrap_sync("write");
FS_SYNC_TRACE_BEGIN(write);
int bytesWritten = SyncCall(env, args[5], &req_wrap_sync, "write",
uv_fs_write, fd, &uvbuf, 1, pos);
Expand Down

0 comments on commit 322056d

Please sign in to comment.