mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
src: free preopen memory in WASI::New()
PR-URL: https://github.com/nodejs/node/pull/30809 Refs: https://github.com/nodejs/node/issues/30257 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
This commit is contained in:
1 parent
e9bda6618d
commit
bf789145d9
1 file changed
+9
@@ -162,6 +162,15 @@ void WASI::New(const FunctionCallbackInfo<Value>& args) {
|
||||
free(options.envp[i]);
|
||||
delete[] options.envp;
|
||||
}
|
||||
|
||||
if (options.preopens != nullptr) {
|
||||
for (uint32_t i = 0; i < options.preopenc; i++) {
|
||||
free(options.preopens[i].mapped_path);
|
||||
free(options.preopens[i].real_path);
|
||||
}
|
||||
|
||||
delete[] options.preopens;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user