aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2017-08-08 10:55:42 +0000
committerAndriy Gapon <avg@FreeBSD.org>2017-08-08 10:55:42 +0000
commitfd6c8b414e97831863daafe189ba223809fbba24 (patch)
treef0622d7cd0e6f62fe31678450cf11cd569edf0a5 /lib
parent59946bc86e82dcfef6355d4a1d4e238ff895be35 (diff)
downloadsrc-fd6c8b414e97831863daafe189ba223809fbba24.tar.gz
src-fd6c8b414e97831863daafe189ba223809fbba24.zip
8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()
illumos/illumos-gate@ba6e7e6505150388de6dc6a88741164118a421bf https://github.com/illumos/illumos-gate/commit/ba6e7e6505150388de6dc6a88741164118a421bf https://www.illumos.org/issues/8430 we should close dirfd if fdopendir() fails. Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Robert Mustacchi <rm@joyent.com> Author: Sowrabha Gopal <sowrabha.gopal@delphix.com>
Notes
Notes: svn path=/vendor/illumos/dist/; revision=322231
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/common/libzfs_mount.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libzfs/common/libzfs_mount.c b/lib/libzfs/common/libzfs_mount.c
index ae6df7fa16e5..dc98d1073fa2 100644
--- a/lib/libzfs/common/libzfs_mount.c
+++ b/lib/libzfs/common/libzfs_mount.c
@@ -209,6 +209,7 @@ dir_is_empty_readdir(const char *dirname)
}
if ((dirp = fdopendir(dirfd)) == NULL) {
+ (void) close(dirfd);
return (B_TRUE);
}