archive: fix allocation leak
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
8ab4a61684
commit
19aed1a049
@ -446,6 +446,7 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header
|
|||||||
}
|
}
|
||||||
buf := bufferPool.Get().([]byte)
|
buf := bufferPool.Get().([]byte)
|
||||||
_, err = io.CopyBuffer(file, reader, buf)
|
_, err = io.CopyBuffer(file, reader, buf)
|
||||||
|
bufferPool.Put(buf)
|
||||||
if err1 := file.Close(); err == nil {
|
if err1 := file.Close(); err == nil {
|
||||||
err = err1
|
err = err1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user