[Bug fortran/29101] Memory leak in gfortran

pault at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Sep 18 19:29:00 GMT 2006



------- Comment #5 from pault at gcc dot gnu dot org  2006-09-18 19:29 -------
Thanks Steven, it was just too obvious, wasn't it?

Index: gcc/fortran/trans-stmt.c
===================================================================
--- gcc/fortran/trans-stmt.c    (revision 117030)
+++ gcc/fortran/trans-stmt.c    (working copy)
@@ -1475,6 +1475,8 @@
   if (n != 0)
     gfc_free (labels);

+  gfc_add_block_to_block (&block, &se.post);
+
   return gfc_finish_block (&block);

now gives


    pstr.6 = (char[1:D.960] *) _gfortran_internal_malloc (D.960);
    tolower (pstr.6, D.960, D.958, D.959);
    goto _gfortran_select_string ((void *) &jumptable.5, 2, &L.5, pstr.6,
D.960);
    L.4:;
    *value = 1;
    goto L.5;
    L.3:;
    __result_validate_value = 0;
    goto L.5;
    L.5:;
    _gfortran_internal_free ((void *) pstr.6);


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stevenb dot gcc at gmail dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29101



More information about the Gcc-bugs mailing list