session: Do not try to access already removed hash
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 9 Apr 2013 16:13:08 +0000 (18:13 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 18 Apr 2013 05:43:46 +0000 (08:43 +0300)
Make sure we never try to cleanup when the hash table has
been destroyed. In this case all resources have been
freed already.

src/session.c

index 69164580ff5174d62bcbc29d335421b5f4655bbc..5f5255e31184f4e0f5d1efe9a6b3a13e9753e271 100644 (file)
@@ -359,6 +359,9 @@ static void remove_policy(struct connman_session_policy *policy)
        gpointer key, value;
        struct connman_session *session;
 
+       if (session_hash == NULL)
+               return;
+
        DBG("policy %p name %s", policy, policy->name);
 
        g_hash_table_iter_init(&iter, session_hash);