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
  • Loading branch information
skomski committed Sep 26, 2015
1 parent c22bcd3 commit 9595025
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 9595025

Please sign in to comment.