mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByID
Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
cd20f59c0b
commit
2ce05af9f2
@ -1654,16 +1654,13 @@ hypervDomainLookupByID(virConnectPtr conn, int id)
|
||||
{
|
||||
virDomainPtr domain = NULL;
|
||||
hypervPrivate *priv = conn->privateData;
|
||||
Msvm_ComputerSystem *computerSystem = NULL;
|
||||
g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
|
||||
|
||||
if (hypervGetVirtualSystemByID(priv, id, &computerSystem) < 0)
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain);
|
||||
|
||||
cleanup:
|
||||
hypervFreeObject((hypervObject *)computerSystem);
|
||||
|
||||
return domain;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user