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:
authorSaar Amar <saaramar5@gmail.com>2016-10-27 06:07:43 +0300
committerGitHub <noreply@github.com>2016-10-27 06:07:43 +0300
commitdfdb01a1a9697a6a48fae9ea17fdc0c59585728c (patch)
treee1badbd6bb898ab36045d03906c37c9b53211b75
parent944df2f9c0269dbac75eaec0ba260053a7788ea8 (diff)
Fix memory leak in ShvVpLoadCallback
-rw-r--r--shvvp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/shvvp.c b/shvvp.c
index 5b4a91e..9437ed5 100644
--- a/shvvp.c
+++ b/shvvp.c
@@ -224,7 +224,7 @@ ShvVpLoadCallback (
_In_ PSHV_CALLBACK_CONTEXT Context
)
{
- PSHV_VP_DATA vpData;
+ PSHV_VP_DATA vpData = NULL;
INT32 status;
//
@@ -262,9 +262,7 @@ ShvVpLoadCallback (
{
//
// Bail out, free the allocated per-processor data
- // Can't free it in Failure, since need to distinguish between the different flows
//
- ShvVpFreeData(vpData, 1);
goto Failure;
}
@@ -277,7 +275,6 @@ ShvVpLoadCallback (
//
// Free the per-processor data
//
- ShvVpFreeData(vpData, 1);
status = SHV_STATUS_NOT_PRESENT;
goto Failure;
}
@@ -292,6 +289,10 @@ Failure:
//
// Return failure
//
+ if (vpData != NULL)
+ {
+ ShvVpFreeData(vpData, 1);
+ }
Context->FailedCpu = ShvOsGetCurrentProcessorNumber();
Context->FailureStatus = status;
return;