diff options
author | Rafael Silva <rafael.nunu@hotmail.com> | 2022-01-28 19:28:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 19:28:46 +0300 |
commit | f98a785dab1a7f520b0cc8e102771b6c5c24a36e (patch) | |
tree | 92376c5181a0989b9d633f723c5307c14ddfc575 /src/node_http2.h | |
parent | 5a61ca63b9ef33cd814c703051bc777a6771f205 (diff) |
http2: fix memory leak on nghttp2 hd threshold
PR-URL: https://github.com/nodejs/node/pull/41502
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r-- | src/node_http2.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_http2.h b/src/node_http2.h index e3d4d70b2d1..5bd715da8a2 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -401,6 +401,10 @@ class Http2Stream : public AsyncWrap, size_t i = 0; for (const auto& header : current_headers_ ) fn(header, i++); + ClearHeaders(); + } + + void ClearHeaders() { current_headers_.clear(); } @@ -787,6 +791,8 @@ class Http2Session : public AsyncWrap, void HandleAltSvcFrame(const nghttp2_frame* frame); void HandleOriginFrame(const nghttp2_frame* frame); + void DecrefHeaders(const nghttp2_frame* frame); + // nghttp2 callbacks static int OnBeginHeadersCallback( nghttp2_session* session, |