Skip to content

Commit

Permalink
x86: fix a mem leaking issue in X86_insn_combine()
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Jan 25, 2014
1 parent 3aebd8c commit 9389947
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/X86/X86Mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -6686,5 +6686,8 @@ void X86_insn_combine(cs_struct *h, cs_insn *insn, cs_insn *prev)
uint8_t prefix = prev->detail->x86.opcode[0];
memmove(prev->detail, insn->detail, sizeof(cs_detail));
prev->detail->x86.prefix[0] = prefix;
// then free unused memory
cs_mem_free(insn->detail);
insn->detail = NULL;
}
}
1 change: 1 addition & 0 deletions suite/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def cs(md, code):

try:
md = Cs(arch, mode)
#md.detail = True

if syntax != 0:
md.syntax = syntax
Expand Down

0 comments on commit 9389947

Please sign in to comment.