This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36276] [4.3/4.4 Regression] possible issue with opening fortran files?
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2008 17:54:46 -0000
- Subject: [Bug fortran/36276] [4.3/4.4 Regression] possible issue with opening fortran files?
- References: <bug-36276-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from burnus at gcc dot gnu dot org 2008-06-16 17:54 -------
Better patch. I'm not sure whether we are ever freeing the memory, but I think
even if not, it is not a big problem.
Index: scanner.c
===================================================================
--- scanner.c (Revision 136838)
+++ scanner.c
@@ -1654,7 +1654,8 @@ preprocessor_line (gfc_char_t *c)
if (strcmp (current_file->filename, filename) != 0)
{
- gfc_free (current_file->filename);
+ /* The current_file->filename may not be freed here as it still needs to
+ be accessible by lookup_line. */
current_file->filename = gfc_getmem (strlen (filename) + 1);
strcpy (current_file->filename, filename);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36276