Commit 520347c
module: fix memory leak when require error occurs
Delete useless module in parent module: parent.children array
when error occurs, so that it can be garbage collected.
Fixes: #32836
PR-URL: #32837
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>1 parent a72d1d3 commit 520347c
File tree
2 files changed
+7
-3
lines changed- lib/internal/modules/cjs
- test/sequential
2 files changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
880 | 887 | | |
881 | 888 | | |
882 | 889 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | 305 | | |
307 | 306 | | |
308 | 307 | | |
309 | 308 | | |
310 | 309 | | |
311 | | - | |
312 | 310 | | |
313 | 311 | | |
314 | 312 | | |
315 | | - | |
316 | 313 | | |
317 | 314 | | |
318 | 315 | | |
| |||
0 commit comments