term: reset: plug memory leak

In reset, we allocated new rows for all the currently visible
lines. We did **not** however, free the 'old' rows.

Fix by not explicitly allocating new rows, but instead allocating
uninitialized rows when needed, and then explicitly erasing the row.

If there already was a row allocated, it is simply erased. If there
wasn't, the a new line is malloc:ed, and then erased.
This commit is contained in:
Daniel Eklöf 2020-04-13 11:42:10 +02:00
parent 3f35a40ff8
commit 27a205e90f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 32 additions and 27 deletions

View file

@ -49,6 +49,7 @@
* OSC 4 with multiple `c;spec` pairs.
* Alt+Return to emit "ESC \r".
* Trackpad sloooow scrolling to eventually scroll a line.
* Memory leak in terminal reset.
### Security