diff --git a/lib/libzfs/os/linux/libzfs_util_os.c b/lib/libzfs/os/linux/libzfs_util_os.c index 7bd26ea98..0ab79be4e 100644 --- a/lib/libzfs/os/linux/libzfs_util_os.c +++ b/lib/libzfs/os/linux/libzfs_util_os.c @@ -274,5 +274,7 @@ zfs_userns(zfs_handle_t *zhp, const char *nspath, int attach) if ((ret = zfs_ioctl(hdl, cmd, &zc)) != 0) zfs_standard_error(hdl, errno, errbuf); + (void) close(zc.zc_cleanup_fd); + return (ret); }