提交 665c8cde 编写于 作者: E Eric Blake

qemu: fix use after free

Detected by Coverity.

* src/qemu/qemu_hotplug.c (qemuDomainAttachHostDevice): Avoid
double free of usb on failure.
上级 73bc94c5
...@@ -1170,6 +1170,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver, ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册