2012-05-12 Tobias Burnus <burnus@net-b.de>
PR fortran/53310
* intrinsics/eoshift2.c (eoshift2): Do not leak
memory by allocating it in the loop.
From-SVN: r187419
+2012-05-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/53310
+ * intrinsics/eoshift2.c (eoshift2): Do not leak
+ memory by allocating it in the loop.
+
2011-08-30 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
ret->offset = 0;
ret->dtype = array->dtype;
+
+ if (arraysize > 0)
+ ret->data = internal_malloc_size (size * arraysize);
+ else
+ ret->data = internal_malloc_size (1);
+
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;
* GFC_DESCRIPTOR_STRIDE(ret,i-1);
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
- if (arraysize > 0)
- ret->data = internal_malloc_size (size * arraysize);
- else
- ret->data = internal_malloc_size (1);
-
}
}
else if (unlikely (compile_options.bounds_check))