diff options
author | Saar Amar <saaramar5@gmail.com> | 2016-10-27 06:07:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-27 06:07:43 +0300 |
commit | dfdb01a1a9697a6a48fae9ea17fdc0c59585728c (patch) | |
tree | e1badbd6bb898ab36045d03906c37c9b53211b75 | |
parent | 944df2f9c0269dbac75eaec0ba260053a7788ea8 (diff) |
Fix memory leak in ShvVpLoadCallback
-rw-r--r-- | shvvp.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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; |