Open youkidearitai opened 1 year ago
For manual https://www.php.net/manual/en/function.mailparse-msg-create.php recommend to use mailparse_msg_free.
It is recommended to call mailparse_msg_free() on the result of this function, when it is no longer needed, to avoid memory leaks.
No leak reported for Release build
=====================================================================
TIME END 2023-08-29 07:16:25
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 79
---------------------------------------------------------------------
Number of tests : 28 28
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 1 ( 3.6%) ( 3.6%)
Tests leaked : 0 ( 0.0%) ( 0.0%)
Tests passed : 27 ( 96.4%) ( 96.4%)
---------------------------------------------------------------------
Time taken : 53 seconds
=====================================================================
From PHP Internals book, it is printed on stderr output during debug builds and nothing during release builds.
I think 2 problems.
Therefore, I think resolve this issue.
I suggest to double check this with a good memory leak detector (e.g. valgrind or MSan), using USE_ZEND_ALLOC=0
; see also https://www.phpinternalsbook.com/php7/memory_management/memory_debugging.html.
Indeed, https://github.com/php/pecl-mail-mailparse/commit/bd4a675032f778d676e1244cd0880c104526b4c9 isn't correct; it causes the memory leaks.
Description
Compile to PHP with
--enable-debug
, then displays memory leak detected. Also tests failed.I know deleted dtor values of bd4a675032f778d676e1244cd0880c104526b4c9. Is there a problem? If no problem, I want to revert them.
Excepted
Fix memory leaks.