server: Avoid invalid memory access when create_console_input fails.

This commit is contained in:
Sebastian Lackner 2015-08-19 12:44:02 +02:00 committed by Alexandre Julliard
parent 0f133aedd5
commit 453d71b9f7
1 changed files with 3 additions and 1 deletions

View File

@ -330,6 +330,7 @@ static struct object *create_console_input( struct thread* renderer, int fd )
if (!console_input->history || (renderer && !console_input->evt) || !console_input->event) if (!console_input->history || (renderer && !console_input->evt) || !console_input->event)
{ {
if (fd != -1) close( fd ); if (fd != -1) close( fd );
console_input->history_size = 0;
release_object( console_input ); release_object( console_input );
return NULL; return NULL;
} }
@ -1111,7 +1112,8 @@ static void console_input_destroy( struct object *obj )
release_object( console_in->evt ); release_object( console_in->evt );
console_in->evt = NULL; console_in->evt = NULL;
} }
release_object( console_in->event ); if (console_in->event)
release_object( console_in->event );
if (console_in->fd) if (console_in->fd)
release_object( console_in->fd ); release_object( console_in->fd );