Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2314378

Browse filesBrowse files
skomskijasnell
authored andcommitted
src: fix u-a-free if uv returns err in ASYNC_CALL
PR-URL: #3049 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent af24376 commit 2314378
Copy full SHA for 2314378

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎src/node_file.cc‎

Copy file name to clipboardExpand all lines: src/node_file.cc
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,10 @@ struct fs_req_wrap {
273273
uv_req->result = err; \
274274
uv_req->path = nullptr; \
275275
After(uv_req); \
276-
} \
277-
args.GetReturnValue().Set(req_wrap->persistent());
276+
req_wrap = nullptr; \
277+
} else { \
278+
args.GetReturnValue().Set(req_wrap->persistent()); \
279+
}
278280

279281
#define ASYNC_CALL(func, req, ...) \
280282
ASYNC_DEST_CALL(func, req, nullptr, __VA_ARGS__) \
@@ -1028,6 +1030,7 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
10281030
uv_req->result = err;
10291031
uv_req->path = nullptr;
10301032
After(uv_req);
1033+
return;
10311034
}
10321035

10331036
return args.GetReturnValue().Set(req_wrap->persistent());

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.