re PR fortran/30430 (Memory corruption in the module search path code)
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Thu, 11 Jan 2007 07:55:10 +0000 (08:55 +0100)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 11 Jan 2007 07:55:10 +0000 (07:55 +0000)
PR fortran/30430
* scanner.c (gfc_release_include_path): Free gfc_option.module_dir
only once!

From-SVN: r120667

gcc/fortran/ChangeLog
gcc/fortran/scanner.c

index 7634dcee40ee0f3b1138e750dc9a83e84b0df388..08084303a83b036cab148fbccae31395dbdaff51 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-11  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/30430
+       * scanner.c (gfc_release_include_path): Free gfc_option.module_dir
+       only once!
+
 2007-01-09  Brooks Moses  <brooks.moses@codesourcery.com>
 
        * simplify.c (gfc_simplify_ibclr): Fix POS comparison.
index cf05306794d5bed03efb6d72824cdf09863bc035..f7c7c8a7ec4bd0ee2d9b790cd1cd06a342e33b8d 100644 (file)
@@ -172,7 +172,6 @@ gfc_release_include_path (void)
 {
   gfc_directorylist *p;
 
-  gfc_free (gfc_option.module_dir);
   while (include_dirs != NULL)
     {
       p = include_dirs;
@@ -181,7 +180,6 @@ gfc_release_include_path (void)
       gfc_free (p);
     }
 
-  gfc_free (gfc_option.module_dir);
   while (intrinsic_modules_dirs != NULL)
     {
       p = intrinsic_modules_dirs;
@@ -189,6 +187,8 @@ gfc_release_include_path (void)
       gfc_free (p->path);
       gfc_free (p);
     }
+
+  gfc_free (gfc_option.module_dir);
 }