Patchwork [Fortran,committed] Free leaks in dependency.c and trans-intrinsics.c

login
register
mail settings
Submitter Tobias Burnus
Date Aug. 27, 2012, 6:48 p.m.
Message ID <503BC0FB.9050500@net-b.de>
Download mbox | patch
Permalink /patch/180266/
State New
Headers show

Comments

Tobias Burnus - Aug. 27, 2012, 6:48 p.m.
Rather simple fix. The first one was leaking expr->value.integer, the 
second one sym->formal_ns.

Build, tested and committed as Rev. 190728.

Tobias

Patch

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(Revision 190714)
+++ gcc/fortran/ChangeLog	(Arbeitskopie)
@@ -1,6 +1,14 @@ 
 2012-08-27  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/54384
+	* dependency.c (check_section_vs_section): Use gfc_free_expr
+	instead of free.
+	* trans-intrinsic.c (conv_generic_with_optional_char_arg): Use
+	gfc_free_symbol instead of free.
+
+2012-08-27  Tobias Burnus  <burnus@net-b.de>
+
+	PR fortran/54384
 	* trans-expr.c (gfc_trans_arrayfunc_assign): Free se.ss
 	and loop.
 
Index: gcc/fortran/dependency.c
===================================================================
--- gcc/fortran/dependency.c	(Revision 190714)
+++ gcc/fortran/dependency.c	(Arbeitskopie)
@@ -1220,7 +1220,7 @@  check_section_vs_section (gfc_array_ref *l_ar, gfc
   else
     start_comparison = -2;
       
-  free (one_expr);
+  gfc_free_expr (one_expr);
 
   /* Determine LHS upper and lower bounds.  */
   if (l_dir == 1)
Index: gcc/fortran/trans-intrinsic.c
===================================================================
--- gcc/fortran/trans-intrinsic.c	(Revision 190714)
+++ gcc/fortran/trans-intrinsic.c	(Arbeitskopie)
@@ -4525,7 +4525,7 @@  conv_generic_with_optional_char_arg (gfc_se* se, g
   sym = gfc_get_symbol_for_expr (expr);
   gfc_conv_procedure_call (se, sym, expr->value.function.actual, expr,
 			  append_args);
-  free (sym);
+  gfc_free_symbol (sym);
 }