https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95104
--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:e1396ee72e68cc8fba99ce986f2910cd39e335b8 commit r10-8202-ge1396ee72e68cc8fba99ce986f2910cd39e335b8 Author: Harald Anlauf <anl...@gmx.de> Date: Thu May 28 21:53:17 2020 +0200 PR fortran/95104 - Segfault on a legal WAIT statement The initial commit for this PR uncovered a latent issue with unit locking in the Fortran run-time library. Add check for valid unit. 2020-05-28 Harald Anlauf <anl...@gmx.de> libgfortran/ PR libfortran/95104 * io/unit.c (unlock_unit): Guard by check for NULL pointer. (cherry picked from commit 6ce3d791dfcba469e709935aba5743640f7d4959)