cache.c:504:22: warning: ‘chain’ may be used uninitialized in this function [-Wmaybe-uninitialized]
cache.c:504:22: warning: ‘table’ may be used uninitialized in this function [-Wmaybe-uninitialized]
erec.c:128:16: warning: ‘line’ may be used uninitialized in this function [-Wmaybe-uninitialized]
optimize.c:524:9: warning: ‘line’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Fixes: 8ad4056e9182 ("erec: expose print_location() and line_location()")
Fixes: afbd102211dc ("src: do not use the nft_cache_filter object from mnl.c")
Fixes: fb298877ece2 ("src: add ruleset optimization infrastructure")
Signed-off-by: Florian Westphal <fw@strlen.de>
const struct nft_cache_filter *filter)
{
struct nftnl_rule_list *rule_cache;
- const char *table;
- const char *chain;
+ const char *table = NULL;
+ const char *chain = NULL;
if (filter) {
table = filter->list.table;
const char *line_location(const struct input_descriptor *indesc,
const struct location *loc, char *buf, size_t bufsiz)
{
- const char *line;
+ const char *line = NULL;
FILE *f;
f = fopen(indesc->name, "r");
{
const struct location *loc = &rule->location;
const struct input_descriptor *indesc = loc->indesc;
- const char *line;
+ const char *line = "";
char buf[1024];
switch (indesc->type) {