remove weird check

After allocation of new_screen, we should check the allocation of this
variable, and return if we cannot allocate.

CID 1100647
This commit is contained in:
Sebastian Dransfeld 2014-03-24 13:35:08 +01:00
parent 839ac5b8d5
commit fe45b5c73f
1 changed files with 2 additions and 2 deletions

View File

@ -754,10 +754,10 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
} }
new_screen = calloc(1, sizeof(Termcell) * new_w * new_h); new_screen = calloc(1, sizeof(Termcell) * new_w * new_h);
if (!ty->screen) if (!new_screen)
{ {
ty->screen2 = NULL;
ERR("memerr"); ERR("memerr");
return;
} }
free(ty->screen2); free(ty->screen2);
ty->screen2 = calloc(1, sizeof(Termcell) * new_w * new_h); ty->screen2 = calloc(1, sizeof(Termcell) * new_w * new_h);