This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/36276] [4.3/4.4 Regression] possible issue with opening fortran files?



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]