[PATCH 26/55] hyperv: use g_autoptr for Msvm_DiskDrive in hypervDomainDefParsePhysicalDisk

Matt Coleman mcoleman at datto.com
Thu Jan 21 18:51:06 UTC 2021


Signed-off-by: Matt Coleman <matt at datto.com>
---
 src/hyperv/hyperv_driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 06eee379a1..40e4c97d35 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -1101,7 +1101,7 @@ hypervDomainDefParsePhysicalDisk(hypervPrivate *priv,
 {
     int result = -1;
     Msvm_ResourceAllocationSettingData *controller = NULL;
-    Msvm_DiskDrive *diskdrive = NULL;
+    g_autoptr(Msvm_DiskDrive) diskdrive = NULL;
     virDomainDiskDefPtr disk = NULL;
     char **hostResource = entry->data->HostResource.data;
     g_autofree char *hostEscaped = NULL;
@@ -1188,7 +1188,6 @@ hypervDomainDefParsePhysicalDisk(hypervPrivate *priv,
  cleanup:
     if (result != 0 && disk)
         virDomainDiskDefFree(disk);
-    hypervFreeObject((hypervObject *)diskdrive);
 
     return result;
 }
-- 
2.30.0





More information about the libvir-list mailing list