diff --git a/drivers/shared/executor/executor.go b/drivers/shared/executor/executor.go index 070e101d5..2bd32dc48 100644 --- a/drivers/shared/executor/executor.go +++ b/drivers/shared/executor/executor.go @@ -177,13 +177,11 @@ func (c *ExecCommand) Stderr() (io.WriteCloser, error) { } func (c *ExecCommand) Close() { - stdout, err := c.Stdout() - if err == nil { - stdout.Close() + if c.stdout != nil { + c.stdout.Close() } - stderr, err := c.Stderr() - if err == nil { - stderr.Close() + if c.stderr != nil { + c.stderr.Close() } }