Skip to content

Commit 26a596b

Browse files
bnoordhuisaddaleax
authored andcommitted
src: fix abort on uv_loop_init() failure
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]>
1 parent d953fa3 commit 26a596b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/spawn_sync.cc

+9-1
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,17 @@ Maybe<bool> SyncProcessRunner::TryInitializeAndRunLoop(Local<Value> options) {
457457
SetError(UV_ENOMEM);
458458
return Just(false);
459459
}
460-
CHECK_EQ(uv_loop_init(uv_loop_), 0);
460+
461+
r = uv_loop_init(uv_loop_);
462+
if (r < 0) {
463+
delete uv_loop_;
464+
uv_loop_ = nullptr;
465+
SetError(r);
466+
return Just(false);
467+
}
461468

462469
if (!ParseOptions(options).To(&r)) return Nothing<bool>();
470+
463471
if (r < 0) {
464472
SetError(r);
465473
return Just(false);

0 commit comments

Comments
 (0)