mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: Fix double free when live-attaching shmem
Function qemuDomainAttachShmemDevice() steals the device data if the hotplug was successful, but the condition checked for unsuccessful execution otherwise. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
e66603539b
commit
cca34e38fd
@ -7615,7 +7615,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
||||
case VIR_DOMAIN_DEVICE_SHMEM:
|
||||
ret = qemuDomainAttachShmemDevice(driver, vm,
|
||||
dev->data.shmem);
|
||||
if (ret < 0) {
|
||||
if (!ret) {
|
||||
alias = dev->data.shmem->info.alias;
|
||||
dev->data.shmem = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user