mirror of
https://github.com/wbenny/hvpp
synced 2026-08-17 04:26:04 -04:00
add check if hypervisor_allocator() exists in the generic_free() method
This fixes crash that occurred if memory was freed/deleted before the hypervisor_allocator is initialized.
This commit is contained in:
parent
7b976e63a3
commit
50fd7bbc2d
1 changed files with 1 additions and 1 deletions
|
|
@ -126,7 +126,7 @@ namespace detail
|
|||
|
||||
void generic_free(void* address) noexcept
|
||||
{
|
||||
return mm::hypervisor_allocator()->contains(address)
|
||||
return (mm::hypervisor_allocator() && mm::hypervisor_allocator()->contains(address))
|
||||
? mm::hypervisor_allocator()->free(address)
|
||||
: mm::system_allocator()->free(address);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue