mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00: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:
parent
c63955ab0f
commit
3e27dbc029
@ -5693,7 +5693,7 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name,
|
|||||||
virJSONValue *cpu_props,
|
virJSONValue *cpu_props,
|
||||||
qemuMonitorCPUModelInfo **model_info)
|
qemuMonitorCPUModelInfo **model_info)
|
||||||
{
|
{
|
||||||
qemuMonitorCPUModelInfo *machine_model = NULL;
|
g_autoptr(qemuMonitorCPUModelInfo) machine_model = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
machine_model = g_new0(qemuMonitorCPUModelInfo, 1);
|
machine_model = g_new0(qemuMonitorCPUModelInfo, 1);
|
||||||
@ -5714,7 +5714,6 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
qemuMonitorCPUModelInfoFree(machine_model);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user