mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-20 12:56:24 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user