[PATCH 3/7] qemu: Use g_autoptr(qemuMonitorCPUModelInfo)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are two instances of an explicit call to
qemuMonitorCPUModelInfoFree() which in fact can be turned into
g_auto().

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c      | 3 +--
 tests/qemumonitorjsontest.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a12ef2227e..eac64bce70 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12395,7 +12395,7 @@ static int
 qemuConnectStealCPUModelFromInfo(virCPUDef *dst,
                                  qemuMonitorCPUModelInfo **src)
 {
-    qemuMonitorCPUModelInfo *info;
+    g_autoptr(qemuMonitorCPUModelInfo) info = NULL;
     size_t i;
     int ret = -1;
 
@@ -12418,7 +12418,6 @@ qemuConnectStealCPUModelFromInfo(virCPUDef *dst,
     ret = 0;
 
  cleanup:
-    qemuMonitorCPUModelInfoFree(info);
     return ret;
 }
 
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 25a91cdeb3..bdf557656b 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2839,7 +2839,7 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
     g_autoptr(qemuMonitorTest) test = NULL;
     g_autoptr(virCPUDef) cpu_a = virCPUDefNew();
     g_autoptr(virCPUDef) cpu_b = virCPUDefNew();
-    qemuMonitorCPUModelInfo *baseline = NULL;
+    g_autoptr(qemuMonitorCPUModelInfo) baseline = NULL;
     int ret = -1;
 
     if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema)))
@@ -2898,7 +2898,6 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
     ret = 0;
 
  cleanup:
-    qemuMonitorCPUModelInfoFree(baseline);
     return ret;
 }
 
-- 
2.32.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux