There's one place (specifically qemuMonitorJSONParseCPUModel())
where we can avoid explicit free call for qemuMonitorCPUModelInfo
struct.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_monitor_json.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 3d89afa6c6..f59688dfd5 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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;
}
--
2.32.0