Windows: Commit() rwTar defer close

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9c7772b83e2382f1c3f0539180e9e6f5644fbbc
Component: engine
This commit is contained in:
John Howard
2015-04-30 12:17:33 -07:00
parent 585f4aedc7
commit fc1f799f60
+5 -1
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 (