From 21a307dd7252a066f204dee52a4cf569a4a48a1d 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 (cherry picked from commit da3f583f30a4b2be9cc5501874373fc4f627158d) --- src/openvpn/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 6968c7710..87d42874a 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1693,6 +1693,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