summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2015-01-28 18:18:50 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-02-26 12:42:15 +0100
commit16771613a89838020ee6d84be40b46c6a8180824 (patch)
treead9fb3125051b83af43b6f24f983a3ca45b29600
parent11d39a131020cc5c54ff9bc86d3259f7d32bf849 (diff)
downloadhqemu-16771613a89838020ee6d84be40b46c6a8180824.zip
hqemu-16771613a89838020ee6d84be40b46c6a8180824.tar.gz
acpi-build: fix memory leak with bridge hp off
When bridge hotplug is disabled for old machine types, we never free memory allocated for temporary tables. Fix this up. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/i386/acpi-build.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 4944249..74586f3 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -859,6 +859,9 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
* to make acpi tables compatible with legacy machine types.
*/
if (!child->pcihp_bridge_en && bus->parent_dev) {
+ build_free_array(bus_table);
+ build_pci_bus_state_cleanup(child);
+ g_free(child);
return;
}
OpenPOWER on IntegriCloud