Skip to content

Commit

Permalink
src: fix abort on uv_loop_init() failure
Browse files Browse the repository at this point in the history
Fixes: #34855

PR-URL: #34874
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
bnoordhuis authored and addaleax committed Sep 22, 2020
1 parent d953fa3 commit 26a596b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/spawn_sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,17 @@ Maybe<bool> SyncProcessRunner::TryInitializeAndRunLoop(Local<Value> options) {
SetError(UV_ENOMEM);
return Just(false);
}
CHECK_EQ(uv_loop_init(uv_loop_), 0);

r = uv_loop_init(uv_loop_);
if (r < 0) {
delete uv_loop_;
uv_loop_ = nullptr;
SetError(r);
return Just(false);
}

if (!ParseOptions(options).To(&r)) return Nothing<bool>();

if (r < 0) {
SetError(r);
return Just(false);
Expand Down

0 comments on commit 26a596b

Please sign in to comment.