Skip to content
Snippets Groups Projects
Commit 370669c0 authored by anonymouspage's avatar anonymouspage
Browse files

ciolib_movetext: Plug fill buffer memory leak

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>>
parent bb233b89
Branches
Tags
No related merge requests found
Pipeline #3287 passed
...@@ -577,6 +577,7 @@ CIOLIBEXPORT int ciolib_movetext(int sx, int sy, int ex, int ey, int dx, int dy) ...@@ -577,6 +577,7 @@ CIOLIBEXPORT int ciolib_movetext(int sx, int sy, int ex, int ey, int dx, int dy)
goto fail; goto fail;
} }
free(buf);
return(1); return(1);
fail: fail:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment