hw/pci-bridge: Fix invalid free()
authorMatthias Weckbecker <matthias@weckbecker.name>
Mon, 10 Dec 2018 13:00:48 +0000 (14:00 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 19 Dec 2018 21:48:16 +0000 (16:48 -0500)
commite7176cdbe4d5e4b68459af741d6493886e4dad29
tree11d7cb3284f97a77cb6223d8a943b666ba957273
parenta2eb5c0cf7cc77736219015b840c5299499b1357
hw/pci-bridge: Fix invalid free()

When loadvm'ing a *running* snapshot qemu crashes due to an invalid
free. It's fortunately caught early by glibc heap memory corruption
protection and qemu gets killed with SIGABRT.

Steps to reproduce:

1) Create VM (e.g w/ virsh define)
2) Start the VM and take a snapshot while it's running and having a
   PCI bridge attached
3) Destroy the VM and revert the running snapshot.

This commit fixes the issue.

Signed-off-by: Matthias Weckbecker <matthias@weckbecker.name>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci_bridge.c