Cygwin: console: Prevent NULL pointer access in close().

- There seems to be a case that shared_console_info is not set yet
  when close() is called. This patch adds guard for such case.
This commit is contained in:
Takashi Yano via Cygwin-patches 2021-02-22 22:30:17 +09:00 committed by Corinna Vinschen
parent 18b91fbe58
commit 6cde7279a0
1 changed files with 1 additions and 1 deletions

View File

@ -1393,7 +1393,7 @@ fhandler_console::close ()
release_output_mutex ();
if (con.owner == myself->pid)
if (shared_console_info && con.owner == myself->pid)
{
char name[MAX_PATH];
shared_name (name, CONS_THREAD_SYNC, get_minor ());