aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/zfs')
-rw-r--r--cmd/zfs/zfs_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 16410d2f2..b9c3a5cf3 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -7275,6 +7275,8 @@ zfs_do_channel_program(int argc, char **argv)
if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
(void) fprintf(stderr, gettext("cannot open pool '%s'"),
poolname);
+ if (fd != 0)
+ (void) close(fd);
return (1);
}
zpool_close(zhp);