From: Simon Tatham Date: Fri, 15 Oct 2004 12:37:44 +0000 (+0000) Subject: Fix two memory leaks in the new code. (There's no point compressing X-Git-Tag: r8855-g4f798d~1052 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ce092c735a312d0b3bac8488ea0b415bdbbcaca0;p=PuTTY_svn.git Fix two memory leaks in the new code. (There's no point compressing 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 :-) git-svn-id: http://svn.tartarus.org/sgt/putty@4638 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/terminal.c b/terminal.c index 9f0f0615..40ad4823 100644 --- a/terminal.c +++ b/terminal.c @@ -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