Browse code

Properly free tuntap struct on android when emulating persist-tun

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>

Arne Schwabe authored on 2018/09/12 20:07:01
Showing 1 changed files
... ...
@@ -1680,6 +1680,9 @@ do_open_tun(struct context *c)
1680 1680
     if (c->c1.tuntap)
1681 1681
     {
1682 1682
         oldtunfd = c->c1.tuntap->fd;
1683
+        free(c->c1.tuntap);
1684
+        c->c1.tuntap = NULL;
1685
+        c->c1.tuntap_owned = false;
1683 1686
     }
1684 1687
 #endif
1685 1688