summaryrefslogtreecommitdiff
path: root/src/node_http2.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-06-15 02:15:04 +0200
committerAnna Henningsen <anna@addaleax.net>2018-06-17 00:12:16 +0200
commit1e54c241322c0f65c569bc20529e2275ec361428 (patch)
tree3ef142defc3984e3903f2443b4526b3803e5668d /src/node_http2.h
parent1da88552ea6d7d4fb5b590b86109053419858f30 (diff)
downloadandroid-node-v8-1e54c241322c0f65c569bc20529e2275ec361428.tar.gz
android-node-v8-1e54c241322c0f65c569bc20529e2275ec361428.tar.bz2
android-node-v8-1e54c241322c0f65c569bc20529e2275ec361428.zip
http2: fix memory leak for uncommon headers
Fix a memory leak that occurs with header names that are short and not present in the static table of default headers. PR-URL: https://github.com/nodejs/node/pull/21336 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r--src/node_http2.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_http2.h b/src/node_http2.h
index 70c284c357..a046ade0fd 100644
--- a/src/node_http2.h
+++ b/src/node_http2.h
@@ -1203,6 +1203,7 @@ class ExternalHeader :
}
if (may_internalize && vec.len < 64) {
+ nghttp2_rcbuf_decref(buf);
// This is a short header name, so there is a good chance V8 already has
// it internalized.
return GetInternalizedString(env, vec);