From: Alex Henrie alexhenrie24@gmail.com
--- programs/conhost/conhost.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index eb3c574789f..419d94c3eed 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -692,8 +692,7 @@ static WCHAR *edit_line_history( struct console *console, unsigned int index ) } else if(console->edit_line.current_history) { - if ((ptr = malloc( (lstrlenW(console->edit_line.current_history) + 1) * sizeof(WCHAR) ))) - lstrcpyW( ptr, console->edit_line.current_history ); + ptr = wcsdup( console->edit_line.current_history ); } return ptr; }