mirror of https://gitee.com/openkylin/libvirt.git
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…
Reference in New Issue