ciolib_movetext: Do not leak fill buffer
- Oct 21, 2022
-
-
anonymouspage authored
As far as I can tell, this free() in ciolib_puttext() is not reachable given the current logic in the function; and, the value of buf is not modified by any called functions. Also, this function is invoked with stack allocated buffers, so it isn't safe to assume a free() is valid in this context. Better to let the owner of the buffer manage the lifecycle.
b1cbde10
-
- Oct 19, 2022
-
-
anonymouspage authored
This fixes a memory leak in ciolib_movetext() which accumulates memory very quickly in scroll heavy ncurses environments. The problem was originally noticed while running syncterm, and confirmed with valgrind. valgrind confirmation: 17,310,720 bytes in 368 blocks are definitely lost in loss record 128 of 128 at 0x8C82899: malloc by 0x16E273: ciolib_movetext (ciolib.c:563) <<snip>>
370669c0
-