joyent/node — pull request #8687 by indutny (2014-11-06 19:05:21+00:00)
Title: 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.

(Discovered at Voxer).

cc @tjfontaine @bnoordhuis