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
1 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,11 @@ func (daemon *Daemon) Commit(container *Container, repository, tag, comment, aut
if err != nil { if err != nil {
return nil, err 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 // Create a new image from the container's base layers + a new layer from container changes
var ( var (