iptables: Avoid NULL pointer dereference in table_cleanup()
authorDaniel Mack <zonque@gmail.com>
Wed, 21 Dec 2011 10:18:20 +0000 (11:18 +0100)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Wed, 25 Jan 2012 09:12:59 +0000 (10:12 +0100)
src/iptables.c

index 807f22c..1494216 100644 (file)
@@ -1152,6 +1152,9 @@ static void table_cleanup(struct connman_iptables *table)
        GList *list;
        struct connman_iptables_entry *entry;
 
+       if (table == NULL)
+               return;
+
        close(table->ipt_sock);
 
        for (list = table->entries; list; list = list->next) {