diff options
author | Saar Amar <saaramar5@gmail.com> | 2016-10-25 01:30:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 01:30:57 +0300 |
commit | 944df2f9c0269dbac75eaec0ba260053a7788ea8 (patch) | |
tree | e730a081a76546ea08d40de9d19dca4f816bada9 | |
parent | a5971726bc6a25aea9f5fc8c336e2c1516e900f5 (diff) |
Update shvvp.c
Fix memory leak in ShvVpLoadCallback. There is a flow (when ShvVpInitialize is failed) that the per-processor data is not freed before the goto Failure and return. Of-course, we can't free it in the Failure, since we need to distinguish between different flows of failures (fail to allocate, fail to initialize, hypervisor not present) So just keep freeing it anytime we fail for some reason (just as when our hypervisor is not present on line 275).
Thanks :)
-rw-r--r-- | shvvp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -261,8 +261,10 @@ ShvVpLoadCallback ( if (status != SHV_STATUS_SUCCESS) { // - // Bail out + // 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; } |