From 108a60d69e2e74f8f375ea60d91f813eef41c546 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 23 Dec 2019 18:31:32 +0200 Subject: [PATCH] lib/encoding/zstd: call zstd.Decoder.Close instead of zstd.Decoder.Reset in order to free up occupied goroutines This should fix goroutine leak for https://github.com/klauspost/compress/issues/195 --- lib/encoding/zstd/stream_pure.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/encoding/zstd/stream_pure.go b/lib/encoding/zstd/stream_pure.go index 50afb7ccf4..15db6312a6 100644 --- a/lib/encoding/zstd/stream_pure.go +++ b/lib/encoding/zstd/stream_pure.go @@ -32,7 +32,7 @@ func (r *Reader) Read(p []byte) (int, error) { // Release releases r. func (r *Reader) Release() { - r.d.Reset(nil) + r.d.Close(nil) r.d = nil }