summaryrefslogtreecommitdiffstats
path: root/iptables/nft.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables/nft.c')
-rw-r--r--iptables/nft.c4
1 files changed, 3 insertions, 1 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;