mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 21:15:22 +00:00
qemu: fix use after free
Detected by Coverity.
* src/qemu/qemu_hotplug.c (qemuDomainAttachHostDevice): Avoid
double free of usb on failure.
(cherry picked from commit 665c8cdecc
)
This commit is contained in:
parent
819df25518
commit
9649b0a8b4
@ -1170,6 +1170,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (usbDeviceListAdd(list, usb) < 0) {
|
if (usbDeviceListAdd(list, usb) < 0) {
|
||||||
usbFreeDevice(usb);
|
usbFreeDevice(usb);
|
||||||
|
usb = NULL:
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user