Merge pull request #2894 from weaveworks/2017-10-16-close-pipe-error-path

docker: Close pipe when the docker API call fails
This commit is contained in:
Damien Lespiau
2017-10-18 12:10:45 +01:00
committed by GitHub

View File

@@ -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)
}