Skip to content

zlib: only apply drain listener if given callback

When stream.flush() is called without a callback, an empty listener is being added. Since flush may be called multiple times to push SSE's down to the client, multiple noop listeners are being added. This in turn causes the memory leak detected message.

fixes #3529 (closed)

This commit has been cherry picked from a pr on v0.x-archive https://github.com/nodejs/node-v0.x-archive/pull/25679

Merge request reports

Loading