machine: properly free device_memory
authorDavid Hildenbrand <david@redhat.com>
Mon, 2 Jul 2018 09:41:52 +0000 (11:41 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Mon, 9 Jul 2018 17:37:48 +0000 (14:37 -0300)
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

index 2077328bcc220b45c30f3a5f91b486debf7b5994..3fad6f880107c27bff50748c94717f7a18bf0b46 100644 (file)
@@ -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)