[Qemu-devel] [PULL 1/2] machine: properly free device_memory

Eduardo Habkost posted 2 patches 7 years, 3 months ago
[Qemu-devel] [PULL 1/2] machine: properly free device_memory
Posted by Eduardo Habkost 7 years, 3 months ago
From: David Hildenbrand <david@redhat.com>

Machines might have inititalized device_memory if they support memory
devices, so let's properly free it.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180702094152.7882-1-david@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/core/machine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2077328bcc..3fad6f8801 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -674,6 +674,7 @@ static void machine_finalize(Object *obj)
     g_free(ms->dumpdtb);
     g_free(ms->dt_compatible);
     g_free(ms->firmware);
+    g_free(ms->device_memory);
 }
 
 bool machine_usb(MachineState *machine)
-- 
2.18.0.rc1.1.g3f1ff2140