Fix ds->opstr leak in ds_build_op_str

This commit is contained in:
Lazula 2022-01-14 17:41:55 -06:00 committed by pancake
parent 77f56015e3
commit 85e3520182

View File

@ -1183,6 +1183,7 @@ static void ds_build_op_str(RDisasmState *ds, bool print_color) {
ds->opstr = strdup (ds->str);
char *asm_str = colorize_asm_string (core, ds, print_color);
if (asm_str) {
free (ds->opstr);
ds->opstr = asm_str;
r_str_ncpy (ds->str, asm_str, sizeof (ds->str));
// strcpy (ds->str, asm_str);