Commit 0d02515d authored by Fedor Indutny's avatar Fedor Indutny Committed by Bert Belder
Browse files

zlib: do not unref() if wasn't ref()ed



In very unlikely case, where `deflateInit2()` may return error (right
now happening only on exhausting all memory), the `ZCtx::Error()` will
be called and will try to `Unref()` the handle. But the problem is that
this handle was never `Ref()`ed, so it will trigger an assertion error
and crash the program.

Reviewed-by: default avatarBen Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8687

Cherry-picked-from: https://github.com/joyent/node/commit/8c868989be778246bc4b9558f087d0f93724b83d
parent 4481cf72
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment