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:
Eric Blake 2012-07-31 08:05:14 -06:00 committed by Cole Robinson
parent 819df25518
commit 9649b0a8b4

View File

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