Always free x86-64 mnemonic in parseOpcode()

This commit is contained in:
Lazula 2022-02-28 12:19:55 -06:00 committed by pancake
parent 2f0ee80e72
commit 3ec4d2d942

View File

@ -5058,7 +5058,7 @@ static int parseOpcode(RAsm *a, const char *op, Opcode *out) {
op += 4;
}
char *args = strchr (op, ' ');
out->mnemonic = args ? r_str_ndup (op, args - op) : strdup (op);
out->mnemonic = args? r_str_ndup (op, args - op): strdup (op);
out->operands[0].type = out->operands[1].type = 0;
out->operands[0].extended = out->operands[1].extended = false;
out->operands[0].reg = out->operands[0].regs[0] = out->operands[0].regs[1] = X86R_UNDEFINED;
@ -5148,6 +5148,7 @@ static int oprep(RAsm *a, ut8 *data, const Opcode *op) {
if (instr.has_bnd) {
retval++;
}
free (instr.mnemonic);
return l + retval;
}
break;