about summary refs log tree commit diff
path: root/libio/genops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/genops.c')
-rw-r--r--libio/genops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libio/genops.c b/libio/genops.c
index 994ee9c0b1..99f5e80f20 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -119,7 +119,8 @@ _IO_link_in (struct _IO_FILE_plus *fp)
       if (_IO_vtable_offset ((FILE *) fp) == 0)
 	{
 	  fp->file._prevchain = (FILE **) &_IO_list_all;
-	  _IO_list_all->file._prevchain = &fp->file._chain;
+	  if (_IO_list_all != NULL)
+	    _IO_list_all->file._prevchain = &fp->file._chain;
 	}
       _IO_list_all = fp;
 #ifdef _IO_MTSAFE_IO