From 4ffb42c8fb8f0d9c2189ba6fbcb1fded222cb68d Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 24 Dec 2009 00:55:32 +0100 Subject: More config.c copy and paste fixes In __connman_config_provision_service(), the config pointer was always set to the last service entry found from the configuration files. This was hiding many bugs introduced by the hexadecimal SSID changes. --- src/config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/config.c b/src/config.c index 6afe7fcf..cd63d407 100644 --- a/src/config.c +++ b/src/config.c @@ -68,7 +68,7 @@ static int load_service(GKeyFile *keyfile, struct connman_config *config) str = g_key_file_get_string(keyfile, "service", "Type", NULL); if (str != NULL) { - g_free(service->ssid); + g_free(service->type); service->type = str; } @@ -91,7 +91,7 @@ static int load_service(GKeyFile *keyfile, struct connman_config *config) g_free(hex_ssid); - g_free(service->type); + g_free(service->ssid); service->ssid = ssid; service->ssid_len = hex_ssid_len / 2; } @@ -415,11 +415,11 @@ int __connman_config_provision_service(struct connman_service *service) ssid_len == config->service->ssid_len) if (config->service->ssid && memcmp(config->service->ssid, ssid, - ssid_len) == 0) + ssid_len) == 0) { + config_service_setup(service, config->service); break; + } } - config_service_setup(service, config->service); - return 0; } -- cgit v1.2.3