Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Silva <rafael.nunu@hotmail.com>2022-01-28 19:28:46 +0300
committerGitHub <noreply@github.com>2022-01-28 19:28:46 +0300
commitf98a785dab1a7f520b0cc8e102771b6c5c24a36e (patch)
tree92376c5181a0989b9d633f723c5307c14ddfc575 /src/node_http2.h
parent5a61ca63b9ef33cd814c703051bc777a6771f205 (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.h6
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,