We only support platforms where free(NULL) is a NOP so that
null checks are useless before free(). Let's drop them to keep
the code clean. There were a few in cfgparse-global, flt_trace,
ssl_sock and stats.
for (i = 1; *args[i]; i++)
len += strlen(args[i]) + 1;
- if (global.desc)
- free(global.desc);
-
+ free(global.desc);
global.desc = d = calloc(1, len);
d += snprintf(d, global.desc + len - d, "%s", args[1]);
goto out;
}
- if (global.node)
- free(global.node);
-
+ free(global.node);
global.node = strdup(args[1]);
}
else if (strcmp(args[0], "unix-bind") == 0) {
return 0;
error:
- if (conf->name)
- free(conf->name);
+ free(conf->name);
free(conf);
return -1;
}
if (ocsp)
ssl_sock_free_ocsp(ocsp);
- if (warn)
- free(warn);
-
+ free(warn);
free(err);
return ret;
for (i = 0; i < STATS_DOMAIN_COUNT; ++i) {
const int domain = domains[i];
- if (stat_cols[domain])
- free(stat_cols[domain]);
+ free(stat_cols[domain]);
}
}
static void free_trash_counters(void)
{
- if (trash_counters)
- free(trash_counters);
+ free(trash_counters);
}
REGISTER_PER_THREAD_FREE(free_trash_counters);