diff options
author | 2019-12-03 05:03:37 +0000 | |
---|---|---|
committer | 2019-12-03 05:03:37 +0000 | |
commit | 7e1f3053e41c8d598f9afd082922c70c09a654e0 (patch) | |
tree | 700a74395d69c1ef3b5dece3c816d39e6db3182c /lib/libc | |
parent | add support for printing RFC 8300 Network Service Header (NSH) (diff) | |
download | wireguard-openbsd-7e1f3053e41c8d598f9afd082922c70c09a654e0.tar.xz wireguard-openbsd-7e1f3053e41c8d598f9afd082922c70c09a654e0.zip |
fwide() does not unlock if error was occurred.
ok guenther@ and deraadt
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/fwide.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/stdio/fwide.c b/lib/libc/stdio/fwide.c index 27ca0f8ac59..4b93d598eab 100644 --- a/lib/libc/stdio/fwide.c +++ b/lib/libc/stdio/fwide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fwide.c,v 1.5 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: fwide.c,v 1.6 2019/12/03 05:03:37 asou Exp $ */ /* $NetBSD: fwide.c,v 1.2 2003/01/18 11:29:54 thorpej Exp $ */ /*- @@ -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; |