struct ifreq ifr;
if(ioctl(device_fd, TAPGIFNAME, (void *)&ifr) == 0) {
- if(iface) {
- free(iface);
- }
-
+ free(iface);
iface = xstrdup(ifr.ifr_name);
}
}
}
void free_config(config_t *cfg) {
- if(cfg->variable) {
- free(cfg->variable);
- }
-
- if(cfg->value) {
- free(cfg->value);
- }
-
- if(cfg->file) {
- free(cfg->file);
- }
-
+ free(cfg->variable);
+ free(cfg->value);
+ free(cfg->file);
free(cfg);
}
cipher->handle = NULL;
}
- if(cipher->key) {
- free(cipher->key);
- cipher->key = NULL;
- }
+ free(cipher->key);
+ cipher->key = NULL;
}
size_t cipher_keylength(const cipher_t *cipher) {
timeout_del(&n->udp_ping_timeout);
- if(n->hostname) {
- free(n->hostname);
- }
-
- if(n->name) {
- free(n->name);
- }
-
- if(n->late) {
- free(n->late);
- }
+ free(n->hostname);
+ free(n->name);
+ free(n->late);
if(n->address_cache) {
close_address_cache(n->address_cache);
}
static void free_past_request(past_request_t *r) {
- if(r->request) {
- free((char *)r->request);
- }
-
+ free((char *)r->request);
free(r);
}
return false;
}
} else {
- if(c->name) {
- free(c->name);
- }
-
+ free(c->name);
c->name = xstrdup(name);
}
free(device);
device = NULL;
- if(iface) {
- free(iface);
- iface = NULL;
- }
+ free(iface);
+ iface = NULL;
device_info = NULL;
}