Commit 2421984 1 parent cea4bd9 commit 2421984 Copy full SHA for 2421984
File tree 1 file changed +4
-2
lines changed
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 {
111
111
CHECK (init_done_ && " close before init" );
112
112
CHECK_LE (mode_, UNZIP);
113
113
114
+ int status = Z_OK;
114
115
if (mode_ == DEFLATE || mode_ == GZIP || mode_ == DEFLATERAW) {
115
- ( void ) deflateEnd (&strm_);
116
+ status = deflateEnd (&strm_);
116
117
int64_t change_in_bytes = -static_cast <int64_t >(kDeflateContextSize );
117
118
env ()->isolate ()->AdjustAmountOfExternalAllocatedMemory (change_in_bytes);
118
119
} else if (mode_ == INFLATE || mode_ == GUNZIP || mode_ == INFLATERAW ||
119
120
mode_ == UNZIP) {
120
- ( void ) inflateEnd (&strm_);
121
+ status = inflateEnd (&strm_);
121
122
int64_t change_in_bytes = -static_cast <int64_t >(kInflateContextSize );
122
123
env ()->isolate ()->AdjustAmountOfExternalAllocatedMemory (change_in_bytes);
123
124
}
125
+ CHECK (status == Z_OK || status == Z_DATA_ERROR);
124
126
mode_ = NONE;
125
127
126
128
if (dictionary_ != nullptr ) {
You can’t perform that action at this time.
0 commit comments