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

Reply via email to