Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

child_process: fix bad abortSignal leak #37257

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,11 +758,14 @@ function spawnWithSignal(file, args, options) {
const opts = options && typeof options === 'object' && ('signal' in options) ?
{ ...options, signal: undefined } :
options;
const child = spawn(file, args, opts);

if (options && options.signal) {
if (options?.signal) {
// Validate signal, if present
validateAbortSignal(options.signal, 'options.signal');
}
const child = spawn(file, args, opts);

if (options && options.signal) {
function kill() {
if (child._handle) {
child._handle.kill(options.killSignal || 'SIGTERM');
Expand Down