Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ionescu007/SimpleVisor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ionescu <ionescu007@users.noreply.github.com>2016-10-30 23:46:33 +0300
committerGitHub <noreply@github.com>2016-10-30 23:46:33 +0300
commit6a777f8fdff63c99a4cab6b1b28c2cb28714a1f5 (patch)
treec31e1565e1e3b4f97e28e13cb73f3e14a4e71362
parenta5971726bc6a25aea9f5fc8c336e2c1516e900f5 (diff)
parentb1f6461c0c212f8e82aeacbfd5ba44b2a3be38e4 (diff)
Merge pull request #15 from saaramar/patch-1
Fix memory leak in shvvp.c
-rw-r--r--shvvp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shvvp.c b/shvvp.c
index 1b34069..097b4bf 100644
--- a/shvvp.c
+++ b/shvvp.c
@@ -227,6 +227,8 @@ ShvVpLoadCallback (
PSHV_VP_DATA vpData;
INT32 status;
+ vpData = NULL;
+
//
// Detect if the hardware appears to support VMX root mode to start.
// No attempts are made to enable this if it is lacking or disabled.
@@ -261,7 +263,7 @@ ShvVpLoadCallback (
if (status != SHV_STATUS_SUCCESS)
{
//
- // Bail out
+ // Bail out, free the allocated per-processor data
//
goto Failure;
}
@@ -275,7 +277,6 @@ ShvVpLoadCallback (
//
// Free the per-processor data
//
- ShvVpFreeData(vpData, 1);
status = SHV_STATUS_NOT_PRESENT;
goto Failure;
}
@@ -290,6 +291,10 @@ Failure:
//
// Return failure
//
+ if (vpData != NULL)
+ {
+ ShvVpFreeData(vpData, 1);
+ }
Context->FailedCpu = ShvOsGetCurrentProcessorNumber();
Context->FailureStatus = status;
return;