summaryrefslogtreecommitdiff
path: root/libgfortran/io/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io/unit.c')
-rw-r--r--libgfortran/io/unit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c
index e168d328665..687f5076a5b 100644
--- a/libgfortran/io/unit.c
+++ b/libgfortran/io/unit.c
@@ -829,7 +829,7 @@ filename_from_unit (int n)
}
/* Get the filename. */
- if (u != NULL)
+ if (u != NULL && u->filename != NULL)
return strdup (u->filename);
else
return (char *) NULL;