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:
parent
c63955ab0f
commit
3e27dbc029
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user