Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-04-02 18:11:45 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-04-02 18:11:45 +0400
commited32dd8946982ea5e49978a5273d6c43991bb4e9 (patch)
tree3870b0db6d5c45476aa795cf3e72867a3efaee49 /winsup/cygwin/fhandler_tty.cc
parentce3124dc193059ed54ea150380d07f316850fcf9 (diff)
* fhandler_tty.cc (fhandler_tty_slave::close): Avoid potential crash
if former open call has been unsuccessful.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r--winsup/cygwin/fhandler_tty.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 4e4dc5338..e9471ce5d 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -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)