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

Merge pull request #12767 from Microsoft/10662-commitdefertarclose

Windows: Commit() rwTar defer close
This commit is contained in:
Michael Crosby 2015-04-30 18:06:09 -07:00
commit 66077a9d69

View file

@ -32,7 +32,11 @@ func (daemon *Daemon) Commit(container *Container, repository, tag, comment, aut
if err != nil {
return nil, err
}
defer rwTar.Close()
defer func() {
if rwTar != nil {
rwTar.Close()
}
}()
// Create a new image from the container's base layers + a new layer from container changes
var (