fwide() does not unlock if error was occurred.

ok?

Index: lib/libc/stdio/fwide.c
===================================================================
RCS file: /cvs/src/lib/libc/stdio/fwide.c,v
retrieving revision 1.5
diff -u -p -r1.5 fwide.c
--- lib/libc/stdio/fwide.c      31 Aug 2015 02:53:57 -0000      1.5
+++ lib/libc/stdio/fwide.c      3 Dec 2019 03:25:26 -0000
@@ -51,8 +51,10 @@ fwide(FILE *fp, int mode)
 
        FLOCKFILE(fp);
        wcio = WCIO_GET(fp);
-       if (!wcio)
+       if (!wcio) {
+               FUNLOCKFILE(fp);
                return 0; /* XXX */
+       }
 
        if (wcio->wcio_mode == 0 && mode != 0)
                wcio->wcio_mode = mode;
--
ASOU Masato

Reply via email to