diff options
author | Christian Pointner <equinox@anytun.org> | 2008-12-28 02:07:13 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-12-28 02:07:13 +0000 |
commit | 5a38cf910fdba0a9a46305fc1480950c208ce66b (patch) | |
tree | 398a1f17c55fc72fffecd8d4cbc0ee34a104ed58 /src | |
parent | added udp socket (diff) |
fixed memory error und udp_close
Diffstat (limited to 'src')
-rw-r--r-- | src/uanytun.c | 2 | ||||
-rw-r--r-- | src/udp.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/uanytun.c b/src/uanytun.c index ca16446..27d1880 100644 --- a/src/uanytun.c +++ b/src/uanytun.c @@ -71,6 +71,7 @@ int main(int argc, char* argv[]) exit(-1); } + log_printf(INFO, "entering main loop"); u_int8_t buf[1600]; int len = 0; @@ -82,6 +83,7 @@ int main(int argc, char* argv[]) cnt++; } tun_close(&dev); + udp_close(&sock); return 0; } @@ -114,6 +114,9 @@ void udp_close(udp_socket_t** sock) if((*sock)->fd_ > 0) close((*sock)->fd_); + + free(*sock); + *sock = NULL; } int udp_read(udp_socket_t* sock, u_int8_t* buf, u_int32_t len, struct sockaddr_storage* remote_end_) |