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

Re: [libvirt] [PATCH] qemu: fix use after free



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 veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


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