mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 13:17:58 +03:00
hyperv: use g_autoptr for Win32_OperatingSystem in hypervNodeGetFreeMemory
Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
00beda0ee2
commit
59daea438e
@ -2701,9 +2701,8 @@ hypervDomainGetSchedulerParameters(virDomainPtr domain,
|
||||
static unsigned long long
|
||||
hypervNodeGetFreeMemory(virConnectPtr conn)
|
||||
{
|
||||
unsigned long long freeMemoryBytes = 0;
|
||||
hypervPrivate *priv = conn->privateData;
|
||||
Win32_OperatingSystem *operatingSystem = NULL;
|
||||
g_autoptr(Win32_OperatingSystem) operatingSystem = NULL;
|
||||
|
||||
if (hypervGetOperatingSystem(priv, &operatingSystem) < 0)
|
||||
return 0;
|
||||
@ -2715,11 +2714,7 @@ hypervNodeGetFreeMemory(virConnectPtr conn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
freeMemoryBytes = operatingSystem->data->FreePhysicalMemory * 1024;
|
||||
|
||||
hypervFreeObject((hypervObject *)operatingSystem);
|
||||
|
||||
return freeMemoryBytes;
|
||||
return operatingSystem->data->FreePhysicalMemory * 1024;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user