Patchwork [Fortran,committed] Fix another two memory leaks

login
register
mail settings
Submitter Tobias Burnus
Date March 1, 2013, 4:45 p.m.
Message ID <5130DB28.1090700@net-b.de>
Download mbox | patch
Permalink /patch/224409/
State New
Headers show

Comments

Tobias Burnus - March 1, 2013, 4:45 p.m.
Committed after regtesting as Rev. 196387. (I forgot to mention that it 
fixes PR56491)
http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00024.html

Tobias

Patch

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(Revision 196386)
+++ gcc/fortran/ChangeLog	(Arbeitskopie)
@@ -1,5 +1,10 @@ 
 2013-03-01  Tobias Burnus  <burnus@net-b.de>
 
+	* iresolve.c (resolve_bound): Use gfc_get_string instead of xstrdup.
+	* symbol.c (free_components): Free proc-pointer components.
+
+2013-03-01  Tobias Burnus  <burnus@net-b.de>
+
 	* trans-decl.c (gfc_trans_deferred_vars): Free expr after use.
 	* trans-io.c (build_dt): Ditto.
 
Index: gcc/fortran/iresolve.c
===================================================================
--- gcc/fortran/iresolve.c	(Revision 196386)
+++ gcc/fortran/iresolve.c	(Arbeitskopie)
@@ -140,7 +140,7 @@  resolve_bound (gfc_expr *f, gfc_expr *array, gfc_e
 	}
     }
 
-  f->value.function.name = xstrdup (name);
+  f->value.function.name = gfc_get_string (name);
 }
 
 
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c	(Revision 196386)
+++ gcc/fortran/symbol.c	(Arbeitskopie)
@@ -2076,6 +2076,7 @@  free_components (gfc_component *p)
 
       gfc_free_array_spec (p->as);
       gfc_free_expr (p->initializer);
+      free (p->tb);
 
       free (p);
     }