about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/fileops.c2
-rw-r--r--libio/iofclose.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/libio/fileops.c b/libio/fileops.c
index dbea6318f0..7144a87289 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -177,6 +177,8 @@ _IO_new_file_close_it (fp)
 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
   else
     {
+      if (_IO_have_wbackup (fp))
+	INTUSE(_IO_free_wbackup_area) (fp);
       INTUSE(_IO_wsetb) (fp, NULL, NULL, 0);
       _IO_wsetg (fp, NULL, NULL, NULL);
       _IO_wsetp (fp, NULL, NULL);
diff --git a/libio/iofclose.c b/libio/iofclose.c
index fb0f7ce19e..62d12244c5 100644
--- a/libio/iofclose.c
+++ b/libio/iofclose.c
@@ -76,9 +76,6 @@ _IO_new_fclose (fp)
       __gconv_release_step (cc->__cd_in.__cd.__steps);
       __gconv_release_step (cc->__cd_out.__cd.__steps);
 #endif
-
-      if (_IO_have_wbackup (fp))
-	INTUSE(_IO_free_wbackup_area) (fp);
     }
   else
     {