Skip to content

Commit 77da629

Browse files
authored
[WasmFS] mmap: avoid setting *allocated too early (#17317)
Setting `*allocated` here is too early, as read errors may occur (causing the pointer to be `free()`'d).
1 parent 7f8dfa7 commit 77da629

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

system/lib/wasmfs/syscalls.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,6 @@ intptr_t _mmap_js(
15291529
if (!ptr) {
15301530
return -ENOMEM;
15311531
}
1532-
*allocated = true;
15331532

15341533
auto written = file->locked().read(ptr, length, offset);
15351534
if (written < 0) {

0 commit comments

Comments
 (0)