Commit 38628e8
Fix phpGH-17399: iconv memory leak on bailout
Wrap bailable sections in php_iconv_string(), _php_iconv_substr(),
_php_iconv_mime_encode(), and _php_iconv_mime_decode() with zend_try/zend_catch
to ensure iconv handles allocated via system malloc are closed if a Zend OOM
bailout fires during smart_str or zend_string operations.
Fixes phpGH-17399
Closes phpGH-215411 parent 86c4877 commit 38628e8
6 files changed
Lines changed: 718 additions & 632 deletions
File tree
- ext/iconv
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
0 commit comments