winedbg: Fix a crash on initial empty input.

This commit is contained in:
Juan Lang 2006-06-02 18:07:42 -07:00 committed by Alexandre Julliard
parent dd4bd4ad28
commit a866fa37e9
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ static size_t last_line_idx = 0;
/* FIXME: should have a pair of buffers, and switch between the two, instead of
* reallocating a new one for each line
*/
if (len == 0 || (len == 1 && tmp[0] == '\n') || (len == 2 && tmp[0] == '\r' && tmp[1] == '\n'))
if (last_line && (len == 0 || (len == 1 && tmp[0] == '\n') || (len == 2 && tmp[0] == '\r' && tmp[1] == '\n')))
{
HeapFree(GetProcessHeap(), 0, tmp);
}