summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-04-05 22:38:39 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-04-11 15:25:07 +0300
commit167aab8ef44d0a601d20f7f77e5e969689582ca8 (patch)
treefc3579102242e42b1ee694f6ce370e402b9c0322 /src
parentac2b56d6d05ffba66c14bdc077de8da7ccc6a9d3 (diff)
downloadconnman-167aab8ef44d0a601d20f7f77e5e969689582ca8.tar.gz
connman-167aab8ef44d0a601d20f7f77e5e969689582ca8.tar.bz2
connman-167aab8ef44d0a601d20f7f77e5e969689582ca8.zip
main: Free g_key_file config immediately after use
Diffstat (limited to 'src')
-rw-r--r--src/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index e539e6d9..354734d3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -400,8 +400,10 @@ int main(int argc, char *argv[])
__connman_dbus_init(conn);
config = load_config(CONFIGDIR "/main.conf");
-
- parse_config(config);
+ if (config != NULL) {
+ parse_config(config);
+ g_key_file_free(config);
+ }
__connman_storage_migrate();
__connman_technology_init();
@@ -491,9 +493,6 @@ int main(int argc, char *argv[])
g_main_loop_unref(main_loop);
- if (config)
- g_key_file_free(config);
-
if (connman_settings.pref_timeservers != NULL)
g_strfreev(connman_settings.pref_timeservers);