diff --git a/src/node_wasi.cc b/src/node_wasi.cc index ffcc37c5274c98..803edf0c91dda1 100644 --- a/src/node_wasi.cc +++ b/src/node_wasi.cc @@ -236,11 +236,9 @@ void WASI::New(const FunctionCallbackInfo& args) { delete[] options.argv; } - if (options.envp != nullptr) { - for (uint32_t i = 0; options.envp[i]; i++) - free(const_cast(options.envp[i])); - delete[] options.envp; - } + for (uint32_t i = 0; options.envp[i]; i++) + free(const_cast(options.envp[i])); + delete[] options.envp; if (options.preopens != nullptr) { for (uint32_t i = 0; i < options.preopenc; i++) {