Hi,

On 14/07/2021 18:25, David Korczynski wrote:
> Signed-off-by: David Korczynski <da...@adalogics.com>

Some commit message is always good - just to give context to the reader
without the need to look at the rest of the code.

But if Gert is fine without it, I am fine too.

> ---
>  src/openvpn/route.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/openvpn/route.c b/src/openvpn/route.c
> index 56fa7717..e429e8c0 100644
> --- a/src/openvpn/route.c
> +++ b/src/openvpn/route.c
> @@ -1584,6 +1584,7 @@ add_route(struct route_ipv4 *r,
> 
>      if (!(r->flags & RT_DEFINED))
>      {
> +        argv_free(&argv);
>          return;
>      }
> 
> @@ -1891,6 +1892,7 @@ add_route_ipv6(struct route_ipv6 *r6, const struct 
> tuntap *tt,
> 
>      if (!(r6->flags & RT_DEFINED) )
>      {
> +        argv_free(&argv);
>          return;
>      }
> 

I agree with Gert that not having RT_DEFINED is indeed impossible with
the current code, because that flag is always set when creating a route.
However, this function does not know about it and it is correct to keep
this check.

Since we keep this check, we indeed need to properly bail out and do not
leak.

Thanks for noticing and fixing this!

Acked-by: Antonio Quartulli <anto...@openvpn.net>


-- 
Antonio Quartulli


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

Reply via email to