pkg / term

Package term manages POSIX terminals.
BSD 2-Clause "Simplified" License
393 stars 64 forks source link

Avoid leaking ptm fd in case of an error #66

Closed tklauser closed 3 years ago

tklauser commented 3 years ago

In func Pty, the ptm fd (pty master) is only wrapped into an *os.File at the end of the function. Before that, ptm needs to be closed explicitly in case of an error.