Re: [PATCH] qemu: fix use after free

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

 



On Tue, Jul 31, 2012 at 08:05:46AM -0600, Eric Blake wrote:
> 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;
>          }
> 

  ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
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]