vz: fix memory leaks in prlsdkLoadDomains

Free sdkdom on any result of prlsdkNewDomainByHandle.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
Nikolay Shirokovskiy 2016-06-08 10:17:21 +03:00 committed by Maxim Nestratov
parent b5e08e8c7e
commit e126352e93

View File

@ -1810,10 +1810,9 @@ prlsdkLoadDomains(vzDriverPtr driver)
pret = PrlResult_GetParamByIndex(result, i, &sdkdom); pret = PrlResult_GetParamByIndex(result, i, &sdkdom);
prlsdkCheckRetGoto(pret, error); prlsdkCheckRetGoto(pret, error);
if (!(dom = prlsdkNewDomainByHandle(driver, sdkdom))) if ((dom = prlsdkNewDomainByHandle(driver, sdkdom)))
continue; virObjectUnlock(dom);
virObjectUnlock(dom);
PrlHandle_Free(sdkdom); PrlHandle_Free(sdkdom);
sdkdom = PRL_INVALID_HANDLE; sdkdom = PRL_INVALID_HANDLE;
} }