Re: [PATCH] nss: Don't leak @ipAddr

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

 



On 09/21/2017 11:48 AM, Michal Privoznik wrote:
> In aiforaf() (which exists only when building for BSD) the
> @ipAddr may be leaked.
>
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  tools/nss/libvirt_nss.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c
> index 9904026da..da4bf79a4 100644
> --- a/tools/nss/libvirt_nss.c
> +++ b/tools/nss/libvirt_nss.c
> @@ -643,6 +643,7 @@ aiforaf(const char *name, int af, struct addrinfo *pai, struct addrinfo **aip)
>          hints.ai_family = af;
>  
>          if (getaddrinfo(ipAddr, NULL, &hints, &res0)) {
> +            VIR_FREE(ipAaddr);
>              addrList++;
>              continue;
>          }
> @@ -654,6 +655,7 @@ aiforaf(const char *name, int af, struct addrinfo *pai, struct addrinfo **aip)
>          while ((*aip)->ai_next)
>             *aip = (*aip)->ai_next;
>  
> +        VIR_FREE(ipAaddr);
>          addrList++;
>      }
>  }

ACK.


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