Index: lib/sanitizer_common/sanitizer_fuchsia.cc =================================================================== --- lib/sanitizer_common/sanitizer_fuchsia.cc +++ lib/sanitizer_common/sanitizer_fuchsia.cc @@ -283,8 +283,14 @@ else CHECK_EQ(addr + size, reinterpret_cast(base_) + size_); size_ -= size; - UnmapOrDieVmar(reinterpret_cast(addr), size, - static_cast(os_handle_)); + const zx_handle_t vmar = static_cast(os_handle_); + UnmapOrDieVmar(reinterpret_cast(addr), size, vmar); + if (!base_) { + // If we unmapped the whole range, destroy and close the vmar. + _zx_vmar_destroy(vmar); + _zx_handle_close(vmar); + os_handle_ = static_cast(ZX_HANDLE_INVALID); + } } // This should never be called.