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:
parent
6f7bbc3171
commit
d7f8b4d43e
1 changed files with 3 additions and 0 deletions
|
@ -235,6 +235,9 @@ func (p *v2Puller) pullV2Tag(tag, taggedName string) (verified bool, err error)
|
|||
// 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()
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue