Commit 178784c
committed
fix: prevent file handle leak when maxFiles is exceeded
Fixes #987
When maxFiles limit is reached, the fileBegin event handler calls _error(),
but _handlePart continues and opens a write stream for the new file.
These file handles are never closed.
Fix: check this.error after emitting fileBegin and before file.open().
If an error occurred (e.g., maxFiles exceeded), decrement _flushing
and return early to prevent the file stream from being opened.1 parent 44768be commit 178784c
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
406 | 412 | | |
407 | 413 | | |
408 | 414 | | |
| |||
0 commit comments