In case iptables_init() errors out early, table_cleanup() will be
called on a NULL pointer. Fix this in by making table_cleanup()
resistent to a NULL pointer argument.

Signed-off-by: Daniel Mack <[email protected]>
---
 src/iptables.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/iptables.c b/src/iptables.c
index 9d6a9e7..4c7637b 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -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) {
-- 
1.7.7.4

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to