qemu: Use g_autoptr(qemuMonitorCPUModelInfo)

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@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
This commit is contained in:
Michal Privoznik 2021-11-01 12:58:27 +01:00
parent 7c2a4e84b7
commit e97be65e65
2 changed files with 2 additions and 4 deletions

View File

@ -12396,7 +12396,7 @@ static int
qemuConnectStealCPUModelFromInfo(virCPUDef *dst,
qemuMonitorCPUModelInfo **src)
{
qemuMonitorCPUModelInfo *info;
g_autoptr(qemuMonitorCPUModelInfo) info = NULL;
size_t i;
int ret = -1;
@ -12419,7 +12419,6 @@ qemuConnectStealCPUModelFromInfo(virCPUDef *dst,
ret = 0;
cleanup:
qemuMonitorCPUModelInfoFree(info);
return ret;
}

View File

@ -2838,7 +2838,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)))
@ -2897,7 +2897,6 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
ret = 0;
cleanup:
qemuMonitorCPUModelInfoFree(baseline);
return ret;
}