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:
Eric Blake 2012-07-31 08:05:14 -06:00
parent 73bc94c56a
commit 665c8cdecc

View File

@ -1170,6 +1170,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
if (usbDeviceListAdd(list, usb) < 0) {
usbFreeDevice(usb);
usb = NULL:
goto cleanup;
}