summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-28 14:20:57 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-07-05 09:17:38 +0200
commit228d8b7833f39e1133411f339e87ab5bd32c5fc7 (patch)
treec10ed32791531b4baf6839c8bc3fd65071983209 /src
parentf85c934398404bd609b31731620e4ca342fc4cc7 (diff)
downloadconnman-228d8b7833f39e1133411f339e87ab5bd32c5fc7.tar.gz
connman-228d8b7833f39e1133411f339e87ab5bd32c5fc7.tar.bz2
connman-228d8b7833f39e1133411f339e87ab5bd32c5fc7.zip
main: Dynamically allocate default blacklist array, free on exit
Diffstat (limited to 'src')
-rw-r--r--src/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 717f1cd0..5c206e76 100644
--- a/src/main.c
+++ b/src/main.c
@@ -160,7 +160,8 @@ static void parse_config(GKeyFile *config)
if (config == NULL) {
connman_settings.auto_connect =
parse_service_types(default_auto_connect, 3);
- connman_settings.blacklisted_interfaces = default_blacklist;
+ connman_settings.blacklisted_interfaces =
+ g_strdupv(default_blacklist);
return;
}
@@ -236,7 +237,8 @@ static void parse_config(GKeyFile *config)
if (error == NULL)
connman_settings.blacklisted_interfaces = interfaces;
else
- connman_settings.blacklisted_interfaces = default_blacklist;
+ connman_settings.blacklisted_interfaces =
+ g_strdupv(default_blacklist);
g_clear_error(&error);
}
@@ -604,6 +606,7 @@ int main(int argc, char *argv[])
g_free(connman_settings.auto_connect);
g_free(connman_settings.preferred_techs);
g_strfreev(connman_settings.fallback_nameservers);
+ g_strfreev(connman_settings.blacklisted_interfaces);
g_free(option_debug);