aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_fuchsia.h
diff options
context:
space:
mode:
Diffstat (limited to 'executor/common_fuchsia.h')
-rw-r--r--executor/common_fuchsia.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/executor/common_fuchsia.h b/executor/common_fuchsia.h
index 892cd853d..646173eba 100644
--- a/executor/common_fuchsia.h
+++ b/executor/common_fuchsia.h
@@ -185,12 +185,19 @@ long syz_mmap(size_t addr, size_t size)
status = zx_vmo_replace_as_executable(vmo, ZX_HANDLE_INVALID, &vmo);
if (status != ZX_OK) {
debug("zx_vmo_replace_as_executable failed with: %d\n", status);
+ // Don't need to zx_handle_close(vmo) because
+ // zx_vmo_replace_as_executable already invalidates it.
return status;
}
uintptr_t mapped_addr;
status = zx_vmar_map(root, ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE,
addr - info.base, vmo, 0, size,
&mapped_addr);
+
+ zx_status_t close_vmo_status = zx_handle_close(vmo);
+ if (close_vmo_status != ZX_OK) {
+ debug("zx_handle_close(vmo) failed with: %d\n", close_vmo_status);
+ }
return status;
}
#endif