From 9d70293b5be731387f9a4a1bcdb0445227a2209f Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 12 Mar 2019 14:52:22 +0000 Subject: [PATCH] dial-stdio: Close the connection This was leaking the fd. Signed-off-by: Ian Campbell (cherry picked from commit 186e7456ac6ddddf31716ca083a2742b132cc225) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 75e9075591ba1d82a055fc50cf36ffcf62a69516 Component: cli --- components/cli/cli/command/system/dial_stdio.go | 1 + 1 file changed, 1 insertion(+) diff --git a/components/cli/cli/command/system/dial_stdio.go b/components/cli/cli/command/system/dial_stdio.go index ceeac8223f..017ed40ce3 100644 --- a/components/cli/cli/command/system/dial_stdio.go +++ b/components/cli/cli/command/system/dial_stdio.go @@ -34,6 +34,7 @@ func runDialStdio(dockerCli command.Cli) error { if err != nil { return errors.Wrap(err, "failed to open the raw stream connection") } + defer conn.Close() var connHalfCloser halfCloser switch t := conn.(type) {