summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/session_policy_local.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/session_policy_local.c b/plugins/session_policy_local.c
index 11b16652..5a8f6b8e 100644
--- a/plugins/session_policy_local.c
+++ b/plugins/session_policy_local.c
@@ -241,9 +241,11 @@ static void policy_local_destroy(struct connman_session *session)
DBG("session %p", session);
policy = g_hash_table_lookup(session_hash, session);
+ if (policy == NULL)
+ return;
+
g_hash_table_remove(session_hash, session);
policy->session = NULL;
-
policy_unref(policy);
}