aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/caf
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <aldot@gcc.gnu.org>2023-05-07 18:32:01 +0200
committerBernhard Reutner-Fischer <aldot@gcc.gnu.org>2023-05-08 07:55:48 +0200
commitca2f64d5d08c1699ca4b7cb2bf6a76692e809e0f (patch)
tree3d98e540a5d13c63b81418d0aa8f4824aa96c137 /libgfortran/caf
parent2521390dd2f8e554ecccb380e0efd7aa21cd4b5f (diff)
downloadgcc-ca2f64d5d08c1699ca4b7cb2bf6a76692e809e0f.zip
gcc-ca2f64d5d08c1699ca4b7cb2bf6a76692e809e0f.tar.gz
gcc-ca2f64d5d08c1699ca4b7cb2bf6a76692e809e0f.tar.bz2
fortran: Remove conditionals around free()
gcc/fortran/ChangeLog: * resolve.cc (resolve_select_type): Call free() unconditionally. libgfortran/ChangeLog: * caf/single.c (_gfortran_caf_register): Call free() unconditionally. * io/async.c (update_pdt, async_io): Likewise. * io/format.c (free_format_data): Likewise. * io/transfer.c (st_read_done_worker, st_write_done_worker): Likewise. * io/unix.c (mem_close): Likewise.
Diffstat (limited to 'libgfortran/caf')
-rw-r--r--libgfortran/caf/single.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c
index bb06bd3..fea8b0c 100644
--- a/libgfortran/caf/single.c
+++ b/libgfortran/caf/single.c
@@ -163,10 +163,8 @@ _gfortran_caf_register (size_t size, caf_register_t type, caf_token_t *token,
/* Freeing the memory conditionally seems pointless, but
caf_internal_error () may return, when a stat is given and then the
memory may be lost. */
- if (local)
- free (local);
- if (*token)
- free (*token);
+ free(local);
+ free(*token);
caf_internal_error (alloc_fail_msg, stat, errmsg, errmsg_len);
return;
}