Skip to content

Commit

Permalink
src: fix u-a-free if uv returns err in ASYNC_CALL
Browse files Browse the repository at this point in the history
PR-URL: nodejs#3049
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
skomski authored and bnoordhuis committed Oct 8, 2015
1 parent a9d42e0 commit ccaaae9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,10 @@ struct fs_req_wrap {
uv_req->result = err; \
uv_req->path = nullptr; \
After(uv_req); \
} \
args.GetReturnValue().Set(req_wrap->persistent());
req_wrap = nullptr; \
} else { \
args.GetReturnValue().Set(req_wrap->persistent()); \
}

#define ASYNC_CALL(func, req, ...) \
ASYNC_DEST_CALL(func, req, nullptr, __VA_ARGS__) \
Expand Down Expand Up @@ -1028,6 +1030,7 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
uv_req->result = err;
uv_req->path = nullptr;
After(uv_req);
return;
}

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

0 comments on commit ccaaae9

Please sign in to comment.