This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR29101 - Memory leak in select case with character expression


On 9/19/06, Paul Thomas <paulthomas2@wanadoo.fr> wrote:
Steven,

>
>
> I bet this still leaks.

I'll grant you that - still, what I committed is an improvement; I'll
re-open the PR, modify it appropriately and figure out what to do in the
longer run.

I think you need to assign the result of the character select to a temporary, then free, then jump. I.e. something like this:


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

 L.4:;
 *value = 1;
 goto L.5;
 L.3:;
 __result_validate_value = 0;
 goto L.5;
 L.5:;

Gr.
Steven


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]