From 4935e56e9aa36a1ca214cc584963c32047a3382e Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Thu, 1 Jun 2023 16:10:34 +0700 Subject: [PATCH] fix nil ptr in close() (#1005) --- compress/decompress.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compress/decompress.go b/compress/decompress.go index 7dbb4ce3e..1e5fe3089 100644 --- a/compress/decompress.go +++ b/compress/decompress.go @@ -339,13 +339,14 @@ func (d *Decompressor) ModTime() time.Time { return d.modTime } -func (d *Decompressor) Close() { +func (d *Decompressor) Close() error { if err := mmap.Munmap(d.mmapHandle1, d.mmapHandle2); err != nil { log.Trace("unmap", "err", err, "file", d.FileName()) } if err := d.f.Close(); err != nil { - log.Trace("Decompressor.Close", "err", err, "file", d.FileName()) + return err } + return nil } func (d *Decompressor) FilePath() string { return d.filePath }