hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByUUID

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Matt Coleman 2021-01-21 13:50:55 -05:00 committed by Laine Stump
parent 2ce05af9f2
commit 38560b7efe

View File

@ -1671,18 +1671,15 @@ hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
virDomainPtr domain = NULL;
hypervPrivate *priv = conn->privateData;
char uuid_string[VIR_UUID_STRING_BUFLEN];
Msvm_ComputerSystem *computerSystem = NULL;
g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
virUUIDFormat(uuid, uuid_string);
if (hypervMsvmComputerSystemFromUUID(priv, uuid_string, &computerSystem) < 0)
goto cleanup;
return NULL;
hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain);
cleanup:
hypervFreeObject((hypervObject *)computerSystem);
return domain;
}