Fixed leakage
This commit is contained in:
parent
73eed89ab3
commit
782cf5a5e8
|
@ -39,6 +39,8 @@ fuzz_target!(|data: &[u8]| {
|
|||
for (i, page) in pages.into_iter().enumerate() {
|
||||
unmap_and_dealloc(&mut vm.memory, page, i as u64 * 4096);
|
||||
}
|
||||
|
||||
let _ = unsafe { Box::from_raw(vm.memory.root_pt) };
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -47,12 +47,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
println!("Program interrupt: {:?}", vm.run());
|
||||
println!("{:?}", vm.registers);
|
||||
|
||||
println!("{:?}", core::slice::from_raw_parts(data, 4096));
|
||||
std::alloc::dealloc(
|
||||
data,
|
||||
std::alloc::Layout::from_size_align_unchecked(4096, 4096),
|
||||
);
|
||||
vm.memory.unmap(8192).unwrap();
|
||||
let _ = Box::from_raw(vm.memory.root_pt);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue