summaryrefslogtreecommitdiff
path: root/libgfortran/intrinsics/spread_generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/intrinsics/spread_generic.c')
-rw-r--r--libgfortran/intrinsics/spread_generic.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libgfortran/intrinsics/spread_generic.c b/libgfortran/intrinsics/spread_generic.c
index 29671ce4c86..2eeb24b8444 100644
--- a/libgfortran/intrinsics/spread_generic.c
+++ b/libgfortran/intrinsics/spread_generic.c
@@ -100,13 +100,10 @@ spread_internal (gfc_array_char *ret, const gfc_array_char *source,
GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride);
}
ret->offset = 0;
- if (rs > 0)
- ret->data = internal_malloc_size (rs * size);
- else
- {
- ret->data = internal_malloc_size (1);
- return;
- }
+ ret->data = internal_malloc_size (rs * size);
+
+ if (rs <= 0)
+ return;
}
else
{