[Patch, Fortran] PR 48700: memory leak with MOVE_ALLOC

Janus Weil janus@gcc.gnu.org
Mon May 16 23:25:00 GMT 2011


Hi all,

here is a simple patch which takes care of fixing a memory leak, which
occurs when calling MOVE_ALLOC with allocatable scalar arguments. We
simply missed to deallocate the second argument 'TO', which is
INTENT(OUT), in case it is already allocated.

The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus



2011-05-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/48700
	* trans-intrinsic.c (gfc_conv_intrinsic_move_alloc): Deallocate 'TO'
	argument to avoid memory leaks.

2011-05-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/48700
	* gfortran.dg/move_alloc_4.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr48700.diff
Type: text/x-diff
Size: 1156 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110516/ed66fa9a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: move_alloc_4.f90
Type: text/x-fortran
Size: 447 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110516/ed66fa9a/attachment-0001.bin>


More information about the Gcc-patches mailing list