Re: [PATCH] node_device: fix memory leak in nodeDeviceSysfsGetSCSIHostCaps

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

 



On Thu, May 25, 2017 at 10:39:48PM -0400, Yi Wang wrote:
> The @tmp is allocated in virVHBAGetConfig in virVHBAIsVportCapable
> condition, it will lost when virVHBAGetConfig called again.
>
> Signed-off-by: Yi Wang <wang.yi59@xxxxxxxxxx>
> ---
>  src/node_device/node_device_linux_sysfs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c
> index 1b7aa94..a9c7c9c 100644
> --- a/src/node_device/node_device_linux_sysfs.c
> +++ b/src/node_device/node_device_linux_sysfs.c
> @@ -95,7 +95,8 @@ nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host)
>              goto cleanup;
>          }
>
> -         if (!(tmp = virVHBAGetConfig(NULL, scsi_host->host,
> +        VIR_FREE(tmp);
> +        if (!(tmp = virVHBAGetConfig(NULL, scsi_host->host,
>                                        "npiv_vports_inuse"))) {
>              VIR_WARN("Failed to read npiv_vports_inuse for host%d",
>                       scsi_host->host);
> --

ACK

I tweaked the commit message a bit, fixed the broken indentation (introduced
prior to your patch - your patch actually made it more visible) and pushed.

Thanks,
Erik

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

--
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]
  Powered by Linux