From 7581fffa8af93cc733055ce27ca5bbfb303dbaec Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Tue, 6 Aug 2019 11:58:44 +0300 Subject: [PATCH] Forgot to check IsInvalid state --- mcs/class/System/System.IO.Compression/DeflateStream.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mcs/class/System/System.IO.Compression/DeflateStream.cs b/mcs/class/System/System.IO.Compression/DeflateStream.cs index 6683de2078a..4c326b0ed92 100644 --- a/mcs/class/System/System.IO.Compression/DeflateStream.cs +++ b/mcs/class/System/System.IO.Compression/DeflateStream.cs @@ -111,7 +111,7 @@ namespace System.IO.Compression if (disposing) GC.SuppressFinalize (this); - native.Dispose (disposing); + native?.Dispose (disposing); if (disposing && !disposed) { disposed = true; @@ -392,11 +392,11 @@ namespace System.IO.Compression io_buffer = null; - if (z_stream != null) { + if (z_stream != null && !z_stream.IsInvalid) { z_stream.Dispose(); } - if (data.IsAllocated) { + if (data != null && data.IsAllocated) { data.Free (); } } -- 2.11.4.GIT