Initialize and finalize op in r_asm_mdisassemble()

This commit is contained in:
Lazula 2022-02-28 11:23:35 -06:00 committed by pancake
parent 189fe015b2
commit edab13d455

View File

@ -692,7 +692,7 @@ R_API RAsmCode* r_asm_mdisassemble(RAsm *a, const ut8 *buf, int len) {
RStrBuf *buf_asm;
RAsmCode *acode;
ut64 pc = a->pc;
RAsmOp op;
RAsmOp op = {0};
ut64 idx;
size_t ret;
const size_t addrbytes = a->user? ((RCore *)a->user)->io->addrbytes: 1;
@ -719,6 +719,7 @@ R_API RAsmCode* r_asm_mdisassemble(RAsm *a, const ut8 *buf, int len) {
r_strbuf_append (buf_asm, r_strbuf_get (&op.buf_asm));
r_strbuf_append (buf_asm, "\n");
}
r_asm_op_fini (&op);
acode->assembly = r_strbuf_drain (buf_asm);
acode->len = idx;
return acode;