Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
static int
hypervDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags)
{
- int result = -1;
- Msvm_ComputerSystem *computerSystem = NULL;
+ g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
virCheckFlags(0, -1);
if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0)
- goto cleanup;
-
- result = computerSystem->data->EnabledState == MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED ? 1 : 0;
-
- cleanup:
- hypervFreeObject((hypervObject *)computerSystem);
+ return -1;
- return result;
+ return computerSystem->data->EnabledState == MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED ? 1 : 0;
}