Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1148724

Browse filesBrowse files
cjihrigtargos
authored andcommitted
src: free preopen memory in WASI::New()
PR-URL: #30809 Refs: #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>
1 parent 808a456 commit 1148724
Copy full SHA for 1148724

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Open diff view settings
Collapse file

‎src/node_wasi.cc‎

Copy file name to clipboardExpand all lines: src/node_wasi.cc
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,15 @@ void WASI::New(const FunctionCallbackInfo<Value>& args) {
162162
free(options.envp[i]);
163163
delete[] options.envp;
164164
}
165+
166+
if (options.preopens != nullptr) {
167+
for (uint32_t i = 0; i < options.preopenc; i++) {
168+
free(options.preopens[i].mapped_path);
169+
free(options.preopens[i].real_path);
170+
}
171+
172+
delete[] options.preopens;
173+
}
165174
}
166175

167176

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.