g_free(file);
}
-static int stats_create(struct connman_service *service)
-{
- struct stats_file *file;
-
- file = g_try_new0(struct stats_file, 1);
- if (file == NULL)
- return -ENOMEM;
-
- g_hash_table_insert(stats_hash, service, file);
-
- return 0;
-}
-
static void update_first(struct stats_file *file)
{
file->first = (struct stats_record *)
file = g_hash_table_lookup(stats_hash, service);
if (file == NULL) {
- err = stats_create(service);
-
- if (err < 0)
- return err;
+ file = g_try_new0(struct stats_file, 1);
+ if (file == NULL)
+ return -ENOMEM;
- file = g_hash_table_lookup(stats_hash, service);
+ g_hash_table_insert(stats_hash, service, file);
} else {
return -EALREADY;
}