Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-04-18 08:37:40 +0300
committerAnna Henningsen <anna@addaleax.net>2016-04-20 19:03:54 +0300
commit29ca969651190c056687788cdd3c5694078cec15 (patch)
tree803df364264be2a958647335a33208e8cc6b8cd7 /src/process_wrap.cc
parentaa4d2ae8972077a893bf2f156e52b350044fc24b (diff)
child_process: add nullptr checks after allocs
Add `CHECK_NE(ยท, nullptr)` after allocations made when spawning child processes. PR-URL: https://github.com/nodejs/node/pull/6256 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/process_wrap.cc')
-rw-r--r--src/process_wrap.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/process_wrap.cc b/src/process_wrap.cc
index dec93ddd0cd..0b7ad41b61a 100644
--- a/src/process_wrap.cc
+++ b/src/process_wrap.cc
@@ -166,6 +166,7 @@ class ProcessWrap : public HandleWrap {
for (int i = 0; i < argc; i++) {
node::Utf8Value arg(env->isolate(), js_argv->Get(i));
options.args[i] = strdup(*arg);
+ CHECK_NE(options.args[i], nullptr);
}
options.args[argc] = nullptr;
}
@@ -187,6 +188,7 @@ class ProcessWrap : public HandleWrap {
for (int i = 0; i < envc; i++) {
node::Utf8Value pair(env->isolate(), env_opt->Get(i));
options.env[i] = strdup(*pair);
+ CHECK_NE(options.env[i], nullptr);
}
options.env[envc] = nullptr;
}