Do not call Put twice and do not call it on defer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael) Upstream-commit: d277a4c0f811e86179770f5098b30adf065567c8 Component: engine
This commit is contained in:
@ -163,7 +163,7 @@ func (img *Image) TarLayer() (arch archive.Archive, err error) {
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
driver.Put(img.ID)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user