diff options
author | Alex Ionescu <ionescu007@users.noreply.github.com> | 2016-10-30 23:46:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-30 23:46:33 +0300 |
commit | 6a777f8fdff63c99a4cab6b1b28c2cb28714a1f5 (patch) | |
tree | c31e1565e1e3b4f97e28e13cb73f3e14a4e71362 | |
parent | a5971726bc6a25aea9f5fc8c336e2c1516e900f5 (diff) | |
parent | b1f6461c0c212f8e82aeacbfd5ba44b2a3be38e4 (diff) |
Merge pull request #15 from saaramar/patch-1
Fix memory leak in shvvp.c
-rw-r--r-- | shvvp.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |