hw/core/machine: fix fdt memory leak
The MachineState fdt field is allocated by various machine types via create_device_tree(), load_device_tree(), or similar, but was never freed in machine_finalize(). Add the missing g_free() call. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260709111249.1107640-1-marcandre.lureau@redhat.com>
Marc-André Lureau committed
Jul 9, 2026 at 15:12 UTC
df42a1589fad9bd140df4e48aabc32b02bea5b22
1 file changed
+1
hw/core/machine.c
+1
@@ -1314,6 +1314,7 @@ static void machine_finalize(Object *obj)
1314
g_free(ms->nvdimms_state);
1315
g_free(ms->numa_state);
1316
g_free(ms->audiodev);
1317
+ g_free(ms->fdt);
1318
}
1319
1320
bool machine_usb(MachineState *machine)