diff options
author | Danny Jeongseok Seo <s.seo@samsung.com> | 2012-11-13 10:44:26 +0900 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-11-13 14:38:27 +0200 |
commit | b44e6d2be6d402fe330cf49509ce2dd859b77b23 (patch) | |
tree | 509a97b7f1c1b51eb65c1b08b1b9162c41e0eae7 /src/iptables.c | |
parent | e5b4117ffa2cccb5acacdafe0df6e8303e8e2df5 (diff) | |
download | connman-b44e6d2be6d402fe330cf49509ce2dd859b77b23.tar.gz connman-b44e6d2be6d402fe330cf49509ce2dd859b77b23.tar.bz2 connman-b44e6d2be6d402fe330cf49509ce2dd859b77b23.zip |
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.
Diffstat (limited to 'src/iptables.c')
-rw-r--r-- | src/iptables.c | 3 |
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; |