[Openvpn-devel] Avoid leak in add_route.

Message ID 20210714134642.12964-1-david@adalogics.com
State Superseded
Headers show
Series
  • [Openvpn-devel] Avoid leak in add_route.
Related show

Commit Message

david korczynski July 14, 2021, 1:46 p.m.
Signed-off-by: David Korczynski <david@adalogics.com>
---
 src/openvpn/route.c | 1 +
 1 file changed, 1 insertion(+)

--
2.17.1

ADA Logics Ltd is registered in England. No: 11624074.
Registered office: 266 Banbury Road, Post Box 292,
OX2 7DL, Oxford, Oxfordshire , United Kingdom

Comments

Gert Doering July 14, 2021, 4:22 p.m. | #1
Hi,

On Wed, Jul 14, 2021 at 02:46:42PM +0100, David Korczynski wrote:
> Signed-off-by: David Korczynski <david@adalogics.com>

This is good :-)

> ---
>  src/openvpn/route.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/openvpn/route.c b/src/openvpn/route.c
> index 3b2af8b4..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;
>      }

... as is this.  Can you send a single patch that contains both fixes?

We try to make patch granularity a good compromise - not too many 
individual patches, so "two one-line fixes for the same problem" would
go into one common patch, not two.

thanks,

gert

Patch

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index 3b2af8b4..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;
     }