diff options
Diffstat (limited to 'iptables/nft.c')
-rw-r--r-- | iptables/nft.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/iptables/nft.c b/iptables/nft.c index dd8469a9..b2165069 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1830,12 +1830,15 @@ bool nft_table_find(struct nft_handle *h, const char *tablename) 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: @@ -1868,6 +1871,7 @@ int nft_for_each_table(struct nft_handle *h, t = nftnl_table_list_iter_next(iter); } + nftnl_table_list_iter_destroy(iter); nftnl_table_list_free(list); return 0; } |