Skip to content

Commit

Permalink
use malloc() rather than calloc() for handle->insn_cache in make_id2i…
Browse files Browse the repository at this point in the history
…nsn()
  • Loading branch information
aquynh committed Jun 9, 2014
1 parent c88d992 commit 12f93cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static unsigned short *make_id2insn(insn_map *insns, unsigned int size)
unsigned short max_id = insns[size - 1].id;
unsigned short i;

unsigned short *cache = (unsigned short *)cs_mem_calloc(sizeof(*cache), max_id + 1);
unsigned short *cache = (unsigned short *)cs_mem_malloc(sizeof(*cache) * (max_id + 1));

for (i = 1; i < size; i++)
cache[insns[i].id] = i;
Expand Down

0 comments on commit 12f93cb

Please sign in to comment.