summaryrefslogtreecommitdiff
path: root/src/arch/x86/op_lea.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2008-09-06 22:07:54 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2008-09-06 22:07:54 (GMT)
commitb52f03ab912cd5e51dc2abea20edee6ad38c26fe (patch)
treec9399ca4d23c1355a83828e95889da5c0d1eedfd /src/arch/x86/op_lea.c
parent4946ffe81e3edf35061a07cf4425f9accff11888 (diff)
Better handled the case where decoding fails.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@26 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/x86/op_lea.c')
-rw-r--r--src/arch/x86/op_lea.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/arch/x86/op_lea.c b/src/arch/x86/op_lea.c
index 2622ebf..c86c07f 100644
--- a/src/arch/x86/op_lea.c
+++ b/src/arch/x86/op_lea.c
@@ -68,7 +68,6 @@ asm_x86_instr *read_instr_lea(const uint8_t *data, off_t *pos, off_t len, uint64
reg1 = x86_create_reg1632_operand_from_modrm(data[*pos], oprsize == AOS_32_BITS, false);
if (reg1 == NULL)
{
- (*pos)--;
free(result);
return NULL;
}
@@ -76,8 +75,8 @@ asm_x86_instr *read_instr_lea(const uint8_t *data, off_t *pos, off_t len, uint64
reg2 = x86_create_content1632_operand(data, pos, len, oprsize == AOS_32_BITS, true);
if (reg2 == NULL)
{
- (*pos)--;
free(result);
+ free(reg1);
return NULL;
}