aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index b050b11..3c09a2a 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -409,6 +409,9 @@ gfc_clear_shape (mpz_t *shape, int rank)
void
gfc_free_shape (mpz_t **shape, int rank)
{
+ if (*shape == NULL)
+ return;
+
gfc_clear_shape (*shape, rank);
free (*shape);
*shape = NULL;
@@ -490,8 +493,7 @@ free_expr0 (gfc_expr *e)
}
/* Free a shape array. */
- if (e->shape != NULL)
- gfc_free_shape (&e->shape, e->rank);
+ gfc_free_shape (&e->shape, e->rank);
gfc_free_ref_list (e->ref);