Move free()s at the end om main() to the proper destructor functions.
[oweals/tinc.git] / src / raw_socket / device.c
index b96f06f4e46a0f61600fa31168f7aa2471d49bd6..9e306b3901b1699f03e4545de8e209a3fa40adab 100644 (file)
@@ -32,8 +32,8 @@
 #include "xalloc.h"
 
 int device_fd = -1;
-char *device;
-char *iface;
+char *device = NULL;
+char *iface = NULL;
 static char ifrname[IFNAMSIZ];
 static char *device_info;
 
@@ -90,6 +90,9 @@ void close_device(void)
        cp();
 
        close(device_fd);
+
+       free(device);
+       free(iface);
 }
 
 bool read_packet(vpn_packet_t *packet)