g_hash_table_iter_init(&iter, user_table);
while (g_hash_table_iter_next(&iter, &key, &value)) {
- uid = (int*)malloc(sizeof(int));
- *uid = *((int*)key);
cache = (struct heart_cpu_dat_cache*)malloc(sizeof(struct heart_cpu_dat_cache));
cache->path = strndup((char*)value, strlen((char*)value));
cache->list = g_hash_table_new_full(
cache->last_file_commit_time = logging_get_time(CLOCK_BOOTTIME);
+ uid = (int*)malloc(sizeof(int));
+ *uid = *((int*)key);
g_hash_table_insert(heart_cpu_app_list, (gpointer)uid, (gpointer)cache);
}
}
{
struct logging_table_form *table = (struct logging_table_form*)data;
if (table->data)
- free(data);
+ free(table->data);
free(table);
}
g_hash_table_iter_init(&iter, user_table);
while (g_hash_table_iter_next(&iter, &key, &value)) {
- uid = (int*)malloc(sizeof(int));
- *uid = *((int*)key);
home_dir = (char*)value;
switch (type) {
_E("Fail to create user default DB");
return RESOURCED_ERROR_DB_FAILED;
}
+
+ uid = (int*)malloc(sizeof(int));
+ *uid = *((int*)key);
db_elem = (struct logging_db*)malloc(sizeof(struct logging_db));
db_elem->path = strndup(path, strlen(path));
db_elem->file = file;
break;
}
}
+ fclose(fp);
if (uid == -1) {
_E("There is no uid in the status file");