summaryrefslogtreecommitdiff
path: root/openvpn
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-10-10 17:08:00 +0200
committerArne Schwabe <arne@rfc2549.org>2012-10-10 17:08:00 +0200
commit9a5adecd6b34e88d707285dc4eaed092585f1f2f (patch)
tree3c57dd5b1bcef54f82c603b121a150bbf512e567 /openvpn
parent9f8f005acc77999f7adcdd58ea4f9e905153c54e (diff)
Fix bug that causes segfault on reconnectv0.5.24
Diffstat (limited to 'openvpn')
-rw-r--r--openvpn/src/openvpn/tun.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/openvpn/src/openvpn/tun.c b/openvpn/src/openvpn/tun.c
index c05d78f8..1b2e5822 100644
--- a/openvpn/src/openvpn/tun.c
+++ b/openvpn/src/openvpn/tun.c
@@ -1405,7 +1405,7 @@ close_tun_generic (struct tuntap *tt)
if (tt->fd >= 0)
close (tt->fd);
if (tt->actual_name)
- free (tt->actual_name);
+ free (tt->actual_name);
clear_tuntap (tt);
}
@@ -1439,7 +1439,8 @@ open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tu
msg (M_ERR, "ERROR: Cannot open TUN");
}
/* Set the actual name to a dummy name to enable scripts */
- tt->actual_name = "vpnservice-tun";
+ tt->actual_name = (char *) malloc(32);
+ strncpy(tt->actual_name, "vpnservice-tun",32);
gc_free (&gc);
}