0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

zlib: Call inflateEnd for UNZIP. Fixes memory leak.

Fix #2595
This commit is contained in:
isaacs 2012-07-08 22:03:37 -07:00
parent d3d83d7b90
commit bf539f9bfd

View File

@ -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_);
}