]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix two memory leaks in the new code. (There's no point compressing
authorSimon Tatham <anakin@pobox.com>
Fri, 15 Oct 2004 12:37:44 +0000 (12:37 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 15 Oct 2004 12:37:44 +0000 (12:37 +0000)
the scrollback if you then leak away all the memory you saved!) One
of the leaks - by far the bigger of the two - was in my temporary
diagnostic function cc_check(), which is particularly embarrassing :-)

[originally from svn r4638]

terminal.c

index 9f0f06152fb3e74e5fe415f4b877549e46b2dc13..40ad4823ba102130748658a37ed742351169203d 100644 (file)
@@ -177,6 +177,8 @@ static void cc_check(termline *line)
        j += (flags[i] != 0);
 
     assert(j == line->size);
+
+    sfree(flags);
 }
 
 /*
@@ -1667,7 +1669,7 @@ static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
 
                addpos234(term->scrollback, compressline(line), sblen);
 
-               line = newline(term, term->cols, TRUE);
+               /* now `line' itself can be reused as the bottom line */
 
                /*
                 * If the user is currently looking at part of the