Patchwork [COMMITTED] Fortran -- fix memory leak in array transformations.

login
register
mail settings
Submitter Steve Kargl
Date Oct. 23, 2011, 10:31 p.m.
Message ID <20111023223131.GA7661@troutmask.apl.washington.edu>
Download mbox | patch
Permalink /patch/121256/
State New
Headers show

Comments

Steve Kargl - Oct. 23, 2011, 10:31 p.m.
2011-10-23  Steven G. Kargl  <kargl@gcc.gnu.org>

    * simplify.c (simplify_transformation_to_array): Fix memory leak.

Patch

Index: simplify.c
===================================================================
--- simplify.c	(revision 180352)
+++ simplify.c	(working copy)
@@ -516,6 +516,7 @@  simplify_transformation_to_array (gfc_ex
      linked-list traversal. Masked elements are set to NULL.  */
   gfc_array_size (array, &size);
   arraysize = mpz_get_ui (size);
+  mpz_clear (size);
 
   arrayvec = XCNEWVEC (gfc_expr*, arraysize);