1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-21 13:57:43 +03:00

qemu_monitor_json: Use g_autoptr() for qemuMonitorCPUModelInfo

There's one place (specifically qemuMonitorJSONParseCPUModel())
where we can avoid explicit free call for qemuMonitorCPUModelInfo
struct.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
This commit is contained in:
Michal Privoznik 2021-10-22 09:58:48 +02:00
parent c63955ab0f
commit 3e27dbc029

View File

@ -5693,7 +5693,7 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name,
virJSONValue *cpu_props,
qemuMonitorCPUModelInfo **model_info)
{
qemuMonitorCPUModelInfo *machine_model = NULL;
g_autoptr(qemuMonitorCPUModelInfo) machine_model = NULL;
int ret = -1;
machine_model = g_new0(qemuMonitorCPUModelInfo, 1);
@ -5714,7 +5714,6 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name,
ret = 0;
cleanup:
qemuMonitorCPUModelInfoFree(machine_model);
return ret;
}