[Openvpn-devel,v1] init: free actual_name when replacing the Android tuntap

Message ID 20261113192654.11321-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] init: free actual_name when replacing the Android tuntap |

Commit Message

Gert Doering Nov. 13, 2026, 7:26 p.m. UTC
  From: Razvan Cojocaru <razvanc@mailbox.org>

With --persist-tun, do_open_tun() frees the old tuntap struct but
not its actual_name, leaking it on every reconnect.

Change-Id: I1295d911c993a02397565e26cece0f0861a2e5f8
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2171
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2171
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Antonio Quartulli <antonio@mandelbit.com>
  

Patch

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 3bc4de4..6664a4d 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -1845,6 +1845,7 @@ 
         if (c->c1.tuntap)
         {
             oldtunfd = c->c1.tuntap->fd;
+            free(c->c1.tuntap->actual_name);
             free(c->c1.tuntap);
             c->c1.tuntap = NULL;
             c->c1.tuntap_owned = false;