Skip to content

Commit 1cf6bf7

Browse files
committed
child_process: add nullptr checks after allocs
Add `CHECK_NE(·, nullptr)` after allocations made when spawning child processes.
1 parent 15f13cd commit 1cf6bf7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/process_wrap.cc

+2
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class ProcessWrap : public HandleWrap {
166166
for (int i = 0; i < argc; i++) {
167167
node::Utf8Value arg(env->isolate(), js_argv->Get(i));
168168
options.args[i] = strdup(*arg);
169+
CHECK_NE(options.args[i], nullptr);
169170
}
170171
options.args[argc] = nullptr;
171172
}
@@ -187,6 +188,7 @@ class ProcessWrap : public HandleWrap {
187188
for (int i = 0; i < envc; i++) {
188189
node::Utf8Value pair(env->isolate(), env_opt->Get(i));
189190
options.env[i] = strdup(*pair);
191+
CHECK_NE(options.env[i], nullptr);
190192
}
191193
options.env[envc] = nullptr;
192194
}

0 commit comments

Comments
 (0)