session_policy_local: Update session before unref policy
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Fri, 31 May 2013 07:13:30 +0000 (09:13 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 31 May 2013 11:39:41 +0000 (14:39 +0300)
The update flag can be removed as it is no longer needed.

plugins/session_policy_local.c

index 21b794d..33152ab 100644 (file)
@@ -347,18 +347,12 @@ static void update_session(struct connman_session *session)
 
 static void remove_policy(struct policy_data *policy)
 {
-       connman_bool_t update = FALSE;
-
-       if (policy->session != NULL)
-               update = TRUE;
+       if (policy->session != NULL) {
+               connman_session_set_default_config(policy->config);
+               update_session(policy->session);
+       }
 
        policy_unref(policy);
-
-       if (update == FALSE)
-               return;
-
-       connman_session_set_default_config(policy->config);
-       update_session(policy->session);
 }
 
 static void notify_handler(struct inotify_event *event,