aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
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/io/unix.c
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/io/unix.c')
-rw-r--r--libgfortran/io/unix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index ba12be0..ef35b85 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -1028,8 +1028,7 @@ mem_flush (unix_stream *s __attribute__ ((unused)))
static int
mem_close (unix_stream *s)
{
- if (s)
- free (s);
+ free(s);
return 0;
}