Skip to content

Commit

Permalink
fix coverity defects
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanpencil authored and radare committed Jun 14, 2018
1 parent 6412a4c commit 5c1ce98
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libr/cons/canvas.c
Expand Up @@ -286,7 +286,6 @@ static int expand_line (RConsCanvas *c, int real_len, int utf8_len) {
int newsize = R_MAX (c->bsize[c->y] * 1.5, c->blen[c->y] + padding);
char * newline = realloc (c->b[c->y], sizeof (*c->b[c->y])*(newsize));
if (!newline) {
r_cons_canvas_free (c);
return false;
}
memset (newline + c->bsize[c->y], 0, newsize - c->bsize[c->y]);
Expand Down Expand Up @@ -340,7 +339,7 @@ R_API void r_cons_canvas_write(RConsCanvas *c, const char *s) {
int utf8_len = utf8len_fixed (s_part, slen);

if (!expand_line (c, real_len, utf8_len)) {
return;
break;
}

if (G (c->x - c->sx, c->y - c->sy)) {
Expand Down Expand Up @@ -478,7 +477,6 @@ R_API int r_cons_canvas_resize(RConsCanvas *c, int w, int h) {
for (j = 0; j <= i; j++) {
free (c->b[i]);
}
free (c->bsize);
free (c->attrs);
free (c->blen);
free (c->bsize);
Expand Down

0 comments on commit 5c1ce98

Please sign in to comment.