]> sourceware.org Git - glibc.git/commitdiff
libio: Attempt wide backup free only for non-legacy code
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Tue, 3 Sep 2024 18:58:33 +0000 (14:58 -0400)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Wed, 4 Sep 2024 13:29:35 +0000 (09:29 -0400)
_wide_data and _mode are not available in legacy code, so do not attempt
to free the wide backup buffer in legacy code.

Resolves: BZ #32137 and BZ #27821

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
libio/genops.c

index 35d8b30710c41dde30a8c34c4561b17b6cbe12dd..6f20d496692a6685ee898fca588c8ebdd498639c 100644 (file)
@@ -819,7 +819,7 @@ _IO_unbuffer_all (void)
       /* Free up the backup area if it was ever allocated.  */
       if (_IO_have_backup (fp))
        _IO_free_backup_area (fp);
-      if (fp->_mode > 0 && _IO_have_wbackup (fp))
+      if (!legacy && fp->_mode > 0 && _IO_have_wbackup (fp))
        _IO_free_wbackup_area (fp);
 
       if (! (fp->_flags & _IO_UNBUFFERED)
This page took 0.038319 seconds and 5 git commands to generate.