* fhandler_tty.cc (fhandler_tty_slave::close): Avoid potential crash

if former open call has been unsuccessful.
This commit is contained in:
Corinna Vinschen 2010-04-02 14:11:45 +00:00
parent ce3124dc19
commit ed32dd8946
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-04-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tty.cc (fhandler_tty_slave::close): Avoid potential crash
if former open call has been unsuccessful.
2010-04-01 Corinna Vinschen <corinna@vinschen.de>
* nlsfuncs.cc: Fix indentation.

View File

@ -613,10 +613,11 @@ fhandler_tty_slave::close ()
close this normally. cgf 2006-05-20 */
cygheap->manage_console_count ("fhandler_tty_slave::close", -1);
archetype->usecount--;
if (archetype)
archetype->usecount--;
report_tty_counts (this, "closed", "");
if (archetype->usecount)
if (archetype && archetype->usecount)
{
#ifdef DEBUGGING
if (archetype->usecount < 0)