struct connman_config_service *service;
const char *ident;
char *str, *hex_ssid;
+ gboolean service_created = FALSE;
/* Strip off "service_" prefix */
ident = group + 8;
return -ENOMEM;
service->ident = g_strdup(ident);
+
+ service_created = TRUE;
}
str = g_key_file_get_string(keyfile, group, SERVICE_KEY_TYPE, NULL);
service->passphrase = str;
}
- g_hash_table_replace(config->service_table, service->ident, service);
+ if (service_created)
+ g_hash_table_insert(config->service_table, service->ident,
+ service);
connman_info("Adding service configuration %s", service->ident);