Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
zlib: Fix use after null when calling .close
An internal zlib error may cause _handle to be set to null.
Close now will check if there is a _handle prior to calling .close on
it.
  • Loading branch information
lightsofapollo committed Mar 31, 2016
commit 094e34ecefe7fe24e8d9fbb03198f7a38fcaf1f6
5 changes: 4 additions & 1 deletion lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ function _close(engine, callback) {

engine._closed = true;

engine._handle.close();
// Caller may invoke .close after a zlib error (which will null _handle).
if (engine._handle) {
engine._handle.close();
}
}

function emitCloseNT(self) {
Expand Down