fix segfault when OOM on the termpty_save module

This commit is contained in:
Boris Faure 2014-09-15 22:07:22 +02:00
parent 90c53f5974
commit 2eb2b9646f
1 changed files with 2 additions and 0 deletions

View File

@ -739,6 +739,8 @@ termpty_line_rewrap(Termpty *ty, int y_start, int y_end,
{
ts2_width = MIN(len_remaining, w2);
ts2 = termpty_save_new(ts2_width);
if (!ts2)
return -1;
line2 = ts2->cell;
back2[y2 + ty->backmax] = ts2;
}