diff options
author | mav <mav@FreeBSD.org> | 2018-03-22 23:56:53 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2018-03-22 23:56:53 +0000 |
commit | 8e876d3d727af465c58f007cf4982ea74c5715ea (patch) | |
tree | 3502c0bd564fbca2c259aae9ea65c3d5f0c30e92 /cddl/contrib/opensolaris/lib/libzfs/common | |
parent | ad1d7dd8cd150536b3c0ffc7f4dd1ac6e26fa0e1 (diff) | |
download | FreeBSD-src-8e876d3d727af465c58f007cf4982ea74c5715ea.zip FreeBSD-src-8e876d3d727af465c58f007cf4982ea74c5715ea.tar.gz |
MFC r329691: MFV r322231:
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>
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c index 42838c9..84b7167 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c @@ -216,6 +216,7 @@ dir_is_empty_readdir(const char *dirname) } if ((dirp = fdopendir(dirfd)) == NULL) { + (void) close(dirfd); return (B_TRUE); } |