Skip to content
Browse files

zlib: Call inflateEnd for UNZIP. Fixes memory leak.

Fix #2595
  • Loading branch information...
1 parent d3d83d7 commit bf539f9bfd2cde4c18557f2607455a4f44fc1565 @isaacs isaacs committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/node_zlib.cc
View
3 src/node_zlib.cc
@@ -63,7 +63,8 @@ class ZCtx : public ObjectWrap {
~ZCtx() {
if (mode_ == DEFLATE || mode_ == GZIP || mode_ == DEFLATERAW) {
(void)deflateEnd(&strm_);
- } else if (mode_ == INFLATE || mode_ == GUNZIP || mode_ == INFLATERAW) {
+ } else if (mode_ == INFLATE || mode_ == GUNZIP || mode_ == INFLATERAW ||
+ mode_ == UNZIP) {
(void)inflateEnd(&strm_);
}

0 comments on commit bf539f9

Please sign in to comment.
Something went wrong with that request. Please try again.