Re: [Qemu-devel] [PATCH for-2.12] vfio-ccw: fix memory leak in vfio_ccw_realize()

2018-04-06 Thread Greg Kurz
On Fri, 6 Apr 2018 18:54:13 +0200 Cornelia Huck wrote: > On Fri, 06 Apr 2018 17:14:19 +0200 > Greg Kurz wrote: > > > The vfio_ccw_realize() function currently leaks vcdev->vdev.name if > > the subchannel is already attached or if vfio_get_device() fails. > > > > This happens because vcdev->vde

Re: [Qemu-devel] [PATCH for-2.12] vfio-ccw: fix memory leak in vfio_ccw_realize()

2018-04-06 Thread Cornelia Huck
On Fri, 06 Apr 2018 17:14:19 +0200 Greg Kurz wrote: > The vfio_ccw_realize() function currently leaks vcdev->vdev.name if > the subchannel is already attached or if vfio_get_device() fails. > > This happens because vcdev->vdev.name is expected to be freed in > vfio_put_device() which isn't calle

[Qemu-devel] [PATCH for-2.12] vfio-ccw: fix memory leak in vfio_ccw_realize()

2018-04-06 Thread Greg Kurz
The vfio_ccw_realize() function currently leaks vcdev->vdev.name if the subchannel is already attached or if vfio_get_device() fails. This happens because vcdev->vdev.name is expected to be freed in vfio_put_device() which isn't called in this case. Adding g_free(vcdev->vdev.name) on these two er