From: Arne Schwabe Date: Wed, 12 Sep 2018 11:07:01 +0000 (+0200) Subject: Properly free tuntap struct on android when emulating persist-tun X-Git-Tag: v2.4.7~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21a307dd7252a066f204dee52a4cf569a4a48a1d;p=thirdparty%2Fopenvpn.git 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) --- 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