[PATCH] qemu: fix use after free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Detected by Coverity.

* src/qemu/qemu_hotplug.c (qemuDomainAttachHostDevice): Avoid
double free of usb on failure.
---
 src/qemu/qemu_hotplug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index ba841e9..ceffe22 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1170,6 +1170,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,

         if (usbDeviceListAdd(list, usb) < 0) {
             usbFreeDevice(usb);
+            usb = NULL:
             goto cleanup;
         }

-- 
1.7.11.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]