Found by Valgrind.
}
static void close_device(void) {
+ free(iface);
+ iface = NULL;
+ free(device);
+ device = NULL;
}
static bool read_packet(vpn_packet_t *packet) {
static void close_device(void) {
close(device_fd);
device_fd = -1;
+ free(iface);
+ iface = NULL;
+ free(device);
+ device = NULL;
}
static inline uint16_t get_ip_ethertype(vpn_packet_t *packet) {
if(myself && myself->connection) {
subnet_update(myself, NULL, false);
- connection_del(myself->connection);
+ free_connection(myself->connection);
}
for(int i = 0; i < listen_sockets; i++) {
return result;
}
+static void cleanup() {
+ free(tinc_conf);
+ free(hosts_dir);
+ free_names();
+}
int main(int argc, char *argv[]) {
program_name = argv[0];
make_names(false);
xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
+ atexit(cleanup);
if(show_version) {
version();