summaryrefslogtreecommitdiff
path: root/src/linux/tun.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-12-27 15:29:59 +0000
committerChristian Pointner <equinox@anytun.org>2008-12-27 15:29:59 +0000
commit3618c5f3d5ad3c88e5143bd699c7bd7a6771bd8f (patch)
treef2897008a792de8f52738a264fbe53d96edea2d1 /src/linux/tun.c
parentadded first version of tun device (needs furhter testing) (diff)
fixed some memory errors at tun device
Diffstat (limited to 'src/linux/tun.c')
-rw-r--r--src/linux/tun.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/linux/tun.c b/src/linux/tun.c
index 005f125..c886335 100644
--- a/src/linux/tun.c
+++ b/src/linux/tun.c
@@ -116,6 +116,15 @@ void tun_close(tun_device_t** dev)
if((*dev)->fd_ > 0)
close((*dev)->fd_);
+ if((*dev)->actual_name_)
+ free((*dev)->actual_name_);
+
+ if((*dev)->local_)
+ free((*dev)->local_);
+
+ if((*dev)->remote_netmask_)
+ free((*dev)->remote_netmask_);
+
free(*dev);
*dev = NULL;
}
@@ -188,4 +197,6 @@ void tun_do_ifconfig(tun_device_t* dev)
log_printf(ERR, "Execution of ifconfig failed");
else
log_printf(NOTICE, "ifconfig returned %d", WEXITSTATUS(result));
+
+ free(command);
}