From: Danny Jeongseok Seo Date: Tue, 13 Nov 2012 01:44:26 +0000 (+0900) Subject: iptables: A file descriptor cannot be a nagative integer X-Git-Tag: 1.10~198 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b44e6d2be6d402fe330cf49509ce2dd859b77b23;p=platform%2Fupstream%2Fconnman.git iptables: A file descriptor cannot be a nagative integer When a socket() has failed and a negative file descriptor has been set, close() cannot accept a negative number as a parameter. --- diff --git a/src/iptables.c b/src/iptables.c index 147d604..16b665a 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;