Unverified Commit e9e4f434 authored by Anna Henningsen's avatar Anna Henningsen Committed by Beth Griggs
Browse files

http2: fix memory leak when headers are not emitted

When headers are not emitted to JS, e.g. because of an error
before that could happen, we currently still have the vector of
previously received headers lying around, each one holding
a reference count of 1.

To fix the resulting memory leak, release them in the `Http2Stream`
destructor.

Also, clear the vector of headers once they have been emitted –
there’s not need to keep it around, wasting memory.

Backport-PR-URL: https://github.com/nodejs/node/pull/22850
PR-URL: https://github.com/nodejs/node/pull/21373


Reviewed-By: default avatarTiancheng "Timothy" Gu <timothygu99@gmail.com>
parent 0f3e6509
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment