Merge pull request #1166 from tonistiigi/alloc_leak

archive: fix allocation leak
This commit is contained in:
Michael Crosby 2017-07-12 10:32:44 -07:00 committed by GitHub
commit 9a5db8715b

View File

@ -446,6 +446,7 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header
}
buf := bufferPool.Get().([]byte)
_, err = io.CopyBuffer(file, reader, buf)
bufferPool.Put(buf)
if err1 := file.Close(); err == nil {
err = err1
}