[Openvpn-devel] networking_iproute2: fix memory leak in net_iface_mtu_set()

Message ID 20201009134603.36263-1-steffan@karger.me
State Accepted
Headers show
Series
  • [Openvpn-devel] networking_iproute2: fix memory leak in net_iface_mtu_set()
Related show

Commit Message

Steffan Karger Oct. 9, 2020, 1:46 p.m.
ASAN yelled at me that someone forgot to call argv_free(). Fix that.

Signed-off-by: Steffan Karger <steffan@karger.me>
---
 src/openvpn/networking_iproute2.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Antonio Quartulli Oct. 9, 2020, 2:34 p.m. | #1
Hi,

On 09/10/2020 15:46, Steffan Karger wrote:
> ASAN yelled at me that someone forgot to call argv_free(). Fix that.
> 
> Signed-off-by: Steffan Karger <steffan@karger.me>

I bet I know that someone!

Thanks a lot for fixing this.

Acked-by: Antonio Quartulli <a@unstable.cc>

(this is for 2.5)
Gert Doering Oct. 9, 2020, 3:24 p.m. | #2
Yeah, very obvious when you look at it :-)  (wasn't *me* who
ACKed that commit... but I had to check to be sure ;-) )

Your patch has been applied to the master and release/2.5 branch.

commit 1e6e083e8888042d58f9541bf74d343d52fc5681 (master)
commit a9c8225439f0acaa679ee59244b5b8660b561592 (release/2.5)
Author: Steffan Karger
Date:   Fri Oct 9 15:46:03 2020 +0200

     networking_iproute2: fix memory leak in net_iface_mtu_set()

     Signed-off-by: Steffan Karger <steffan@karger.me>
     Acked-by: Antonio Quartulli <a@unstable.cc>
     Message-Id: <20201009134603.36263-1-steffan@karger.me>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21189.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/networking_iproute2.c b/src/openvpn/networking_iproute2.c
index f3b9c614..3b460527 100644
--- a/src/openvpn/networking_iproute2.c
+++ b/src/openvpn/networking_iproute2.c
@@ -88,6 +88,8 @@  net_iface_mtu_set(openvpn_net_ctx_t *ctx, const char *iface, uint32_t mtu)
     argv_msg(M_INFO, &argv);
     openvpn_execve_check(&argv, ctx->es, S_FATAL, "Linux ip link set failed");
 
+    argv_free(&argv);
+
     return 0;
 }