Commit 78df9cb9 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

conhost: Fix memory leak on error path in create_screen_buffer (cppcheck).

parent 36af6828
......@@ -100,7 +100,11 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int
if (screen_buffer->font.face_len)
{
screen_buffer->font.face_name = malloc( screen_buffer->font.face_len * sizeof(WCHAR) );
if (!screen_buffer->font.face_name) return NULL;
if (!screen_buffer->font.face_name)
{
free( screen_buffer );
return NULL;
}
memcpy( screen_buffer->font.face_name, console->active->font.face_name,
screen_buffer->font.face_len * sizeof(WCHAR) );
......
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