mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-27 00:51:18 +02:00
Fix minor resource leak in runCmdHeadless
We still want to close the pty if the command failed.
This commit is contained in:
@ -85,6 +85,7 @@ func runCmdHeadless(cmd *exec.Cmd) error {
|
||||
_, _ = io.Copy(io.Discard, f)
|
||||
|
||||
if cmd.Wait() != nil {
|
||||
_ = f.Close()
|
||||
// return an error with the stderr output
|
||||
return errors.New(stderr.String())
|
||||
}
|
||||
|
Reference in New Issue
Block a user