Hi,

On Thu, Feb 09, 2023 at 04:36:58PM +0100, Petr ??tetiar wrote:
> diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
> index a883ac4a156c..d304554cefda 100644
> --- a/src/openvpn/socket.c
> +++ b/src/openvpn/socket.c
> @@ -172,7 +172,10 @@ get_addr_generic(sa_family_t af, unsigned int flags, 
> const char *hostname,
>          *sep = '/';
>      }
>  out:
> -    freeaddrinfo(ai);
> +    if (ai)
> +    {
> +        freeaddrinfo(ai);
> +    }
>      free(var_host);

The patch itself is fine, but as Arne says, maybe we should then add
this to all places where freeaddrinfo() is called and could be NULL - so
we're at least consistent in our interpretation of "should we pass NULL?".

gert


-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to