Skip to content

Commit

Permalink
fixed memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonomango committed May 16, 2022
1 parent a7cc7c8 commit df81495
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hv/hv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ static bool find_offsets() {

// allocate the hypervisor and vcpus
static bool create() {
memset(&ghv, 0, sizeof(ghv));

ghv.vcpu_count = KeQueryActiveProcessorCount(nullptr);

// size of the vcpu array
Expand Down Expand Up @@ -101,6 +103,8 @@ bool start() {
KeRevertToUserAffinityThreadEx(orig_affinity);
}

ExFreePoolWithTag(ghv.vcpus, 'fr0g');

return true;
}

Expand Down

0 comments on commit df81495

Please sign in to comment.