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

Laine Stump laine at laine.org
Thu Sep 21 18:25:22 UTC 2017


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 at redhat.com>
> ---
>  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.





More information about the libvir-list mailing list