Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
zlib: Call inflateEnd for UNZIP. Fixes memory leak.
Browse files Browse the repository at this point in the history
Fix #2595
  • Loading branch information
isaacs committed Jul 9, 2012
1 parent d3d83d7 commit bf539f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node_zlib.cc
Expand Up @@ -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_);
}

Expand Down

0 comments on commit bf539f9

Please sign in to comment.