File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -111,16 +111,18 @@ class ZCtx : public AsyncWrap {
111111 CHECK (init_done_ && " close before init" );
112112 CHECK_LE (mode_, UNZIP);
113113
114+ int status = Z_OK;
114115 if (mode_ == DEFLATE || mode_ == GZIP || mode_ == DEFLATERAW) {
115- ( void ) deflateEnd (&strm_);
116+ status = deflateEnd (&strm_);
116117 int64_t change_in_bytes = -static_cast <int64_t >(kDeflateContextSize );
117118 env ()->isolate ()->AdjustAmountOfExternalAllocatedMemory (change_in_bytes);
118119 } else if (mode_ == INFLATE || mode_ == GUNZIP || mode_ == INFLATERAW ||
119120 mode_ == UNZIP) {
120- ( void ) inflateEnd (&strm_);
121+ status = inflateEnd (&strm_);
121122 int64_t change_in_bytes = -static_cast <int64_t >(kInflateContextSize );
122123 env ()->isolate ()->AdjustAmountOfExternalAllocatedMemory (change_in_bytes);
123124 }
125+ CHECK (status == Z_OK || status == Z_DATA_ERROR);
124126 mode_ = NONE;
125127
126128 if (dictionary_ != nullptr ) {
You can’t perform that action at this time.
0 commit comments