From 8953e201d6a55a5a563619bf3c220ef5de65f4ff Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Thu, 24 Jul 2025 17:56:31 +0400 Subject: [PATCH] error handling improved in zlib --- contrib/epee/include/zlib_helper.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/epee/include/zlib_helper.h b/contrib/epee/include/zlib_helper.h index f63b5897..196aa107 100644 --- a/contrib/epee/include/zlib_helper.h +++ b/contrib/epee/include/zlib_helper.h @@ -98,6 +98,7 @@ namespace zlib_helper if (ret != Z_OK) { LOCAL_ASSERT(0); + inflateEnd(&zstream); return false; } @@ -108,6 +109,7 @@ namespace zlib_helper if (ret != Z_OK && ret != Z_STREAM_END) { LOCAL_ASSERT(0); + inflateEnd(&zstream); return false; } @@ -118,6 +120,7 @@ namespace zlib_helper if(ungzip_buff_size == zstream.avail_out) { LOG_ERROR("Can't unpack buffer"); + inflateEnd(&zstream); return false; }