Fix tiny memleak in panels reported by coverity

This commit is contained in:
pancake 2017-12-27 18:31:09 +01:00
parent 36f056d67b
commit 8afa433190
2 changed files with 6 additions and 1 deletions

View File

@ -2327,6 +2327,7 @@ static int ds_print_meta_infos(RDisasmState *ds, ut8* buf, int len, int idx) {
break;
case 0: /* temporary legacy workaround */
esc_bslash = false;
/* fallthrough */
default:
out = r_str_escape_latin1 (mi->str, false, esc_bslash);
}

View File

@ -159,7 +159,11 @@ static void Panel_print(RConsCanvas *can, Panel *n, int cur) {
white[idx] = 0;
text = r_str_ansi_crop (foo,
0, delta_y, n->w + delta_x - 2, n->h - 2 + delta_y);
text = r_str_prefix_all (text, white);
char *newText = r_str_prefix_all (text, white);
if (newText) {
free (text);
text = newText;
}
} else {
text = r_str_ansi_crop (foo,
delta_x, delta_y, n->w + delta_x - 2, n->h - 2 + delta_y);