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 :-)

[originally from svn r4638]
This commit is contained in:
Simon Tatham 2004-10-15 12:37:44 +00:00
Родитель aa3c6302b1
Коммит 70230fc0ca
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -177,6 +177,8 @@ static void cc_check(termline *line)
j += (flags[i] != 0); j += (flags[i] != 0);
assert(j == line->size); 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); 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 * If the user is currently looking at part of the