diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2011-01-17 07:48:10 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2011-01-17 07:48:10 +0200 |
commit | 9cd72574bcdf3fb8ec5bf203a4968aae8c321eae (patch) | |
tree | 2dfa4f7e5bab4c7c2953b9e4aa9c0005366a126f /libgfortran/io/unix.c | |
parent | 124b5e3620753f9829b81b92cc2b1fa3a7fe9762 (diff) | |
download | gcc-9cd72574bcdf3fb8ec5bf203a4968aae8c321eae.zip gcc-9cd72574bcdf3fb8ec5bf203a4968aae8c321eae.tar.gz gcc-9cd72574bcdf3fb8ec5bf203a4968aae8c321eae.tar.bz2 |
PR47296 Segfault when running out of file descriptors
From-SVN: r168888
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r-- | libgfortran/io/unix.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index e66560f..fa64e20 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + 2011 Free Software Foundation, Inc. Contributed by Andy Vaught F2003 I/O support contributed by Jerry DeLisle @@ -1084,13 +1085,8 @@ tempfile (st_parameter_open *opp) while (fd == -1 && errno == EEXIST); #endif /* HAVE_MKSTEMP */ - if (fd < 0) - free (template); - else - { - opp->file = template; - opp->file_len = strlen (template); /* Don't include trailing nul */ - } + opp->file = template; + opp->file_len = strlen (template); /* Don't include trailing nul */ return fd; } |