about summary refs log tree commit diff
path: root/libio/iosetbuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iosetbuffer.c')
-rw-r--r--libio/iosetbuffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libio/iosetbuffer.c b/libio/iosetbuffer.c
index d3fc7e5917..e44f33962f 100644
--- a/libio/iosetbuffer.c
+++ b/libio/iosetbuffer.c
@@ -31,12 +31,13 @@ _IO_setbuffer (fp, buf, size)
      _IO_size_t size;
 {
   CHECK_FILE (fp, );
+  __libc_cleanup_region_start (&_IO_funlockfile, fp);
   _IO_flockfile (fp);
   fp->_flags &= ~_IO_LINE_BUF;
   if (!buf)
     size = 0;
   (void) _IO_SETBUF (fp, buf, size);
-  _IO_funlockfile (fp);
+  __libc_cleanup_region_end (1);
 }
 
 weak_alias (_IO_setbuffer, setbuffer)