Skip to content

Commit

Permalink
clean up all memory that's been remapped so far upon a remap failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeash committed Feb 2, 2012
1 parent 4c99cbd commit 0fe36a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AllocateMirrored.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void *allocate_mirrored(size_t howmuch, unsigned howmany)

if(err == KERN_PROTECTION_FAILURE)
{
CHECK_ERR(vm_deallocate(mach_task_self(), (vm_address_t)mem, howmuch), 0);
CHECK_ERR(vm_deallocate(mach_task_self(), (vm_address_t)mem, howmuch * i), 0);
mem = NULL;
}
else
Expand Down

0 comments on commit 0fe36a9

Please sign in to comment.