summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-07-10 17:00:55 +0000
committerguenther <guenther@openbsd.org>2012-07-10 17:00:55 +0000
commitae130eabfc2bdd20a4c17d27d56e393dc0fc65e1 (patch)
tree44b61cc9050a594a8495bf4d16548f0c61e94e35
parentDo not write spaces around = in addr.py so it can also be read by (diff)
downloadwireguard-openbsd-ae130eabfc2bdd20a4c17d27d56e393dc0fc65e1.tar.xz
wireguard-openbsd-ae130eabfc2bdd20a4c17d27d56e393dc0fc65e1.zip
Don't release a FILE that wan't allocated. Found by benno@
ok matthew@ benno@
-rw-r--r--sys/kern/vfs_syscalls.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 530d29baf78..c6462898d5e 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.185 2012/07/08 10:55:10 guenther Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.186 2012/07/10 17:00:55 guenther Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -856,8 +856,10 @@ doopenat(struct proc *p, int fd, const char *path, int oflags, mode_t mode,
struct nameidata nd;
fdplock(fdp);
- if ((error = falloc(p, &fp, &indx)) != 0)
- goto out;
+ if ((error = falloc(p, &fp, &indx)) != 0) {
+ fdpunlock(fdp);
+ return (error);
+ }
flags = FFLAGS(oflags);
if (flags & O_CLOEXEC)
fdp->fd_ofileflags[indx] |= UF_EXCLOSE;