From da3f583f30a4b2be9cc5501874373fc4f627158d Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 12 Sep 2018 13:07:01 +0200 Subject: [PATCH] Properly free tuntap struct on android when emulating persist-tun Trac-Ticket: #851 Acked-by: Gert Doering Message-Id: <20180912110701.31609-1-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17460.html Signed-off-by: Gert Doering --- src/openvpn/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 2933d5558..b1f4320aa 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1680,6 +1680,9 @@ do_open_tun(struct context *c) if (c->c1.tuntap) { oldtunfd = c->c1.tuntap->fd; + free(c->c1.tuntap); + c->c1.tuntap = NULL; + c->c1.tuntap_owned = false; } #endif -- 2.47.2