summaryrefslogtreecommitdiffstats
path: root/iptables
diff options
context:
space:
mode:
Diffstat (limited to 'iptables')
-rw-r--r--iptables/nft.c4
-rw-r--r--iptables/xtables-standalone.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/iptables/nft.c b/iptables/nft.c
index b3d9646d..fa01e241 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -767,8 +767,10 @@ int nft_init(struct nft_handle *h, struct builtin_table *t)
if (h->nl == NULL)
return -1;
- if (mnl_socket_bind(h->nl, 0, MNL_SOCKET_AUTOPID) < 0)
+ if (mnl_socket_bind(h->nl, 0, MNL_SOCKET_AUTOPID) < 0) {
+ mnl_socket_close(h->nl);
return -1;
+ }
h->portid = mnl_socket_get_portid(h->nl);
h->tables = t;
diff --git a/iptables/xtables-standalone.c b/iptables/xtables-standalone.c
index 139c477f..1a28c548 100644
--- a/iptables/xtables-standalone.c
+++ b/iptables/xtables-standalone.c
@@ -66,7 +66,6 @@ xtables_main(int family, const char *progname, int argc, char *argv[])
xtables_globals.program_name,
xtables_globals.program_version,
strerror(errno));
- nft_fini(&h);
exit(EXIT_FAILURE);
}