diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2013-04-09 18:13:12 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-04-18 08:44:04 +0300 |
commit | f9e7f5c9b73fd81e2b1ccd89833506c8e66156aa (patch) | |
tree | 0bc205c4f792c836fe36c6bc111e707e7eb347ac /plugins | |
parent | 024b7ab98be603e7586aa5b36c8a65725b8b2ce4 (diff) | |
download | connman-f9e7f5c9b73fd81e2b1ccd89833506c8e66156aa.tar.gz connman-f9e7f5c9b73fd81e2b1ccd89833506c8e66156aa.tar.bz2 connman-f9e7f5c9b73fd81e2b1ccd89833506c8e66156aa.zip |
session_policy_local: Do not free policy on load error
We should not unref the policy on parsing errors becase the policy
lifetime is attached to the lifetime of the file. When the file
is removed we remove it from the hash table.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/session_policy_local.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/session_policy_local.c b/plugins/session_policy_local.c index fa8349f4..aa734a14 100644 --- a/plugins/session_policy_local.c +++ b/plugins/session_policy_local.c @@ -390,6 +390,7 @@ static void notify_handler(struct inotify_event *event, const char *ident) { struct policy_data *policy; + int err; if (ident == NULL) return; @@ -411,8 +412,10 @@ static void notify_handler(struct inotify_event *event, if (event->mask & IN_MODIFY) { connman_info("Policy modifed for '%s'", ident); - if (load_policy(policy) < 0) { - remove_policy(policy); + err = load_policy(policy); + if (err < 0) { + connman_warn("Loading policy file '%s' failed with %s", + ident, strerror(-err)); return; } } |