Commit 3ba9a44
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.
PR-URL: #21373
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>1 parent 81046f9 commit 3ba9a44Copy full SHA for 3ba9a44
File tree
Expand file treeCollapse file tree
2 files changed
+10
-11
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
2 files changed
+10
-11
lines changedOpen diff view settings
Collapse file
+8-5Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1127 | 1127 | |
1128 | 1128 | |
1129 | 1129 | |
1130 | | - |
1131 | | - |
| 1130 | + |
1132 | 1131 | |
1133 | 1132 | |
1134 | 1133 | |
| ||
1145 | 1144 | |
1146 | 1145 | |
1147 | 1146 | |
1148 | | - |
| 1147 | + |
1149 | 1148 | |
1150 | | - |
| 1149 | + |
1151 | 1150 | |
1152 | 1151 | |
1153 | 1152 | |
| ||
1156 | 1155 | |
1157 | 1156 | |
1158 | 1157 | |
1159 | | - |
1160 | 1158 | |
1161 | 1159 | |
1162 | 1160 | |
| ||
1710 | 1708 | |
1711 | 1709 | |
1712 | 1710 | |
| 1711 | + |
| 1712 | + |
| 1713 | + |
| 1714 | + |
| 1715 | + |
1713 | 1716 | |
1714 | 1717 | |
1715 | 1718 | |
|
Collapse file
+2-6Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
592 | 592 | |
593 | 593 | |
594 | 594 | |
595 | | - |
596 | | - |
| 595 | + |
| 596 | + |
597 | 597 | |
598 | 598 | |
599 | 599 | |
600 | 600 | |
601 | 601 | |
602 | 602 | |
603 | | - |
604 | | - |
605 | | - |
606 | | - |
607 | 603 | |
608 | 604 | |
609 | 605 | |
|
0 commit comments