diff options
Diffstat (limited to 'runsc/console')
-rw-r--r-- | runsc/console/console.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runsc/console/console.go b/runsc/console/console.go index 2f2745b2b..3df184742 100644 --- a/runsc/console/console.go +++ b/runsc/console/console.go @@ -40,6 +40,7 @@ func NewWithSocket(socketPath string) (*os.File, error) { ptySlave.Close() return nil, fmt.Errorf("error dial socket %q: %v", socketPath, err) } + defer conn.Close() uc, ok := conn.(*net.UnixConn) if !ok { ptySlave.Close() @@ -50,6 +51,7 @@ func NewWithSocket(socketPath string) (*os.File, error) { ptySlave.Close() return nil, fmt.Errorf("error getting file for unix socket %v: %v", uc, err) } + defer socket.Close() // Send the master FD over the connection. msg := unix.UnixRights(int(ptyMaster.Fd())) |