In case iptables_init() errors out early, 'table' is still NULL. Calling
table_cleanup() on it causes a SIGSEGV in the daemon.

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

diff --git a/src/iptables.c b/src/iptables.c
index 9d6a9e7..3b95cb5 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1241,7 +1241,8 @@ static struct connman_iptables *iptables_init(char 
*table_name)
 err:
        g_free(module);
 
-       table_cleanup(table);
+       if (table)
+               table_cleanup(table);
 
        return NULL;
 }
-- 
1.7.7.3

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

Reply via email to