Skip to content

Commit 4f6f599

Browse files
lightsofapolloMylesBorins
authored andcommitted
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. PR-URL: #5982 Fixes: #6034 Reviewed-By: Brian White <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent d9cd449 commit 4f6f599

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/zlib.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,9 @@ Zlib.prototype.close = function(callback) {
469469

470470
this._closed = true;
471471

472-
this._handle.close();
472+
if (this._handle) {
473+
this._handle.close();
474+
}
473475

474476
process.nextTick(emitCloseNT, this);
475477
};

0 commit comments

Comments
 (0)