mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
qemu: fix memleak in qemuDomainAttachDeviceLive()
During disk hot plugging, qemuDomainAttachDeviceLive() adds the new disk to the device list of the VM object. However, hot plugging cdroms and floppies only updates the src variable of the original disk device, so the newly generated disk object needs to be freed. Signed-off-by: Jin Yan <jinyan12@huawei.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7187b8e2b6
commit
2f470a4fb1
@ -1115,6 +1115,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
|
||||
return -1;
|
||||
|
||||
disk->src = NULL;
|
||||
virDomainDiskDefFree(disk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user