From 1cf6bf75ff08f894987e71715ca5ea5904dff67f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 18 Apr 2016 07:37:40 +0200 Subject: [PATCH] child_process: add nullptr checks after allocs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `CHECK_NE(ยท, nullptr)` after allocations made when spawning child processes. --- src/process_wrap.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/process_wrap.cc b/src/process_wrap.cc index dec93ddd0cd02c..0b7ad41b61a5ae 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; }