Skip to content

Commit 0f3e650

Browse files
addaleaxBethGriggs
authored andcommitted
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. Backport-PR-URL: #22850 PR-URL: #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>
1 parent 0a8d086 commit 0f3e650

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_http2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ class ExternalHeader :
12991299
}
13001300

13011301
if (may_internalize && vec.len < 64) {
1302+
nghttp2_rcbuf_decref(buf);
13021303
// This is a short header name, so there is a good chance V8 already has
13031304
// it internalized.
13041305
return GetInternalizedString(env, vec);

0 commit comments

Comments
 (0)