]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Properly free tuntap struct on android when emulating persist-tun
authorArne Schwabe <arne@rfc2549.org>
Wed, 12 Sep 2018 11:07:01 +0000 (13:07 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 25 Sep 2018 14:23:59 +0000 (16:23 +0200)
Trac-Ticket: #851
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
src/openvpn/init.c

index 2933d555812961bd874ca463b0a0892342897bb5..b1f4320aa4740156b21eac11e7822b273e6e9b90 100644 (file)
@@ -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