summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/iptables.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/iptables.c b/src/iptables.c
index 147d6042..16b665aa 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1207,7 +1207,8 @@ static void table_cleanup(struct connman_iptables *table)
if (table == NULL)
return;
- close(table->ipt_sock);
+ if (table->ipt_sock >= 0)
+ close(table->ipt_sock);
for (list = table->entries; list; list = list->next) {
entry = list->data;