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(a)redhat.com>
---
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