From 65b0c4b59214c84b9b09a2a39dd86edef0cde7cc Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sat, 25 Dec 2021 10:54:28 +0100 Subject: [PATCH] chunked: release zstd on termination --- storage/pkg/chunked/storage_linux.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/pkg/chunked/storage_linux.go b/storage/pkg/chunked/storage_linux.go index ce5d283349..611a9dd881 100644 --- a/storage/pkg/chunked/storage_linux.go +++ b/storage/pkg/chunked/storage_linux.go @@ -1185,6 +1185,11 @@ func parseBooleanPullOption(storeOpts *storage.StoreOptions, name string, def bo func (c *chunkedDiffer) ApplyDiff(dest string, options *archive.TarOptions) (graphdriver.DriverWithDifferOutput, error) { defer c.layersCache.release() + defer func() { + if c.zstdReader != nil { + c.zstdReader.Close() + } + }() bigData := map[string][]byte{ bigDataKey: c.manifest,