From 5990ad4947e741c86d7fb98e3fbd238bfd0f2007 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Mon, 16 Oct 2017 23:30:46 +0100 Subject: [PATCH] docker: Close pipe when the docker API call fails This hasn't been found in the wild but by code inspection. If we fail the docker API call, the pipe is never closed. Close it before returning. --- probe/docker/controls.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/probe/docker/controls.go b/probe/docker/controls.go index f2eb51e6e..f51fc4651 100644 --- a/probe/docker/controls.go +++ b/probe/docker/controls.go @@ -86,6 +86,7 @@ func (r *registry) attachContainer(containerID string, req xfer.Request) xfer.Re ErrorStream: local, }) if err != nil { + pipe.Close() return xfer.ResponseError(err) } pipe.OnClose(func() { @@ -133,6 +134,7 @@ func (r *registry) execContainer(containerID string, req xfer.Request) xfer.Resp ErrorStream: local, }) if err != nil { + pipe.Close() return xfer.ResponseError(err) }