1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix goroutine leak on pull

Close the pipeWriter even if there was no error.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2015-08-31 14:24:05 -07:00
parent 166412e529
commit 3037e4f7c4

View file

@ -230,6 +230,9 @@ func (p *v2Puller) pullV2Tag(out io.Writer, tag, taggedName string) (verified bo
// set the error. All successive reads/writes will return with this
// error.
pipeWriter.CloseWithError(errors.New("download canceled"))
} else {
// If no error then just close the pipe.
pipeWriter.Close()
}
}()