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