Mostly to reduce noise from valgrind output, add missing calls to
destroy iterators in nft.c and add cleanup for the populated nft_handle
in xtables_eb_save_main().
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
const char *this_tablename =
nftnl_table_get(t, NFTNL_TABLE_NAME);
- if (strcmp(tablename, this_tablename) == 0)
- return true;
+ if (strcmp(tablename, this_tablename) == 0) {
+ ret = true;
+ break;
+ }
t = nftnl_table_list_iter_next(iter);
}
+ nftnl_table_list_iter_destroy(iter);
nftnl_table_list_free(list);
err:
t = nftnl_table_list_iter_next(iter);
}
+ nftnl_table_list_iter_destroy(iter);
nftnl_table_list_free(list);
return 0;
}
}
nft_for_each_table(&h, __ebt_save, !!ctr);
+ nft_fini(&h);
return 0;
}