mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-04 10:34:55 +02:00
Fix minor resource leak in runCmdHeadless
We still want to close the pty if the command failed.
This commit is contained in:
parent
10fe872c71
commit
26d180a50a
@ -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())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user