From: Samuel Ortiz Date: Wed, 23 Dec 2009 23:55:32 +0000 (+0100) Subject: More config.c copy and paste fixes X-Git-Tag: 0.48~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ffb42c8fb8f0d9c2189ba6fbcb1fded222cb68d;p=platform%2Fupstream%2Fconnman.git 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. --- diff --git a/src/config.c b/src/config.c index 6afe7fc..cd63d40 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; }