Commit a866fa37 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

winedbg: Fix a crash on initial empty input.

parent dd4bd4ad
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment