mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
zlib: fix crash when initializing failed
Unset `mode_` when initializing the zlib stream failed, so that we don’t try to call the zlib end functions (`deflateEnd()` etc.) when cleaning up in `ZCtx::Close()`. Fixes: https://github.com/nodejs/node/issues/14178 Ref: https://github.com/nodejs/node/pull/13098 Backport-PR-URL: https://github.com/nodejs/node/pull/14860 PR-URL: https://github.com/nodejs/node/pull/14666 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
This commit is contained in:
parent
31bf595b94
commit
a1f992975f
|
|
@ -480,6 +480,7 @@ class ZCtx : public AsyncWrap {
|
|||
delete[] dictionary;
|
||||
ctx->dictionary_ = nullptr;
|
||||
}
|
||||
ctx->mode_ = NONE;
|
||||
ctx->env()->ThrowError("Init error");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user