_DBG("%s", dump_p->str);//write
if (write(fd, dump_p->str, dump_p->len) < 0)
_WARN("write error");
- int *temp_id = (int *)malloc(4);
- *temp_id = (amap_data->id + 10000);
- _DBG("Insert id %d, str %s, res %d", *temp_id, temp_str,
- g_hash_table_insert(app_map, temp_id, temp_str));
g_string_free(dump_p, TRUE);
+ int *temp_id = (int *)calloc(1, sizeof(int));
+ if (temp_id != NULL) {
+ *temp_id = (amap_data->id + 10000);
+ _DBG("Insert id %d, str %s, res %d", *temp_id, temp_str,
+ g_hash_table_insert(app_map, temp_id, temp_str));
+ } else {
+ _WARN("Memory Allocation Failed");
+ g_free(temp_str);
+ }
}
bm_set_free_gslist_appid_map(list);
// Dump the elapsed time from last event
// It should be dumped without storing
GString *dump_tmp_p = g_string_sized_new(30);
+ BM_CHECK_MEM_ALLOC(dump_tmp_p, {});
struct timeval tv;
gettimeofday(&tv, NULL);