Skip to content

Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt#14708

Closed
ndossche wants to merge 1 commit intophp:PHP-8.2from
ndossche:fix-14590
Closed

Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt#14708
ndossche wants to merge 1 commit intophp:PHP-8.2from
ndossche:fix-14590

Conversation

@ndossche
Copy link
Copy Markdown
Member

@ndossche ndossche commented Jun 28, 2024

The issue is not related to FPM. Values retrieved from zend_getenv should be freed.
Making a test is not trivial because the CLI sapi doesn't implement the sapi getenv hook, so zend_getenv always returns NULL.

@ndossche ndossche linked an issue Jun 28, 2024 that may be closed by this pull request
Values retrieved from zend_getenv should be freed.
@devnexen
Copy link
Copy Markdown
Member

Quick (genuine) question, if it depends on the actual sapi, do all callbacks use zend alloc api consistently for every case (and platforms) ?

@ndossche
Copy link
Copy Markdown
Member Author

The only possible value for zend_getenv is sapi_getenv which uses zend alloc to duplicate the string that it reads from the SAPI module.

@devnexen
Copy link
Copy Markdown
Member

Makes sense thx.

@ndossche ndossche closed this in 056bec7 Jun 28, 2024
@jorgsowa
Copy link
Copy Markdown
Contributor

Thank you for fixing it! Why can't you take a minimal test case from the bug report? Example without correct OUTPUT: master...jorgsowa:php-src:bug-gh-14590-test-case

@ndossche
Copy link
Copy Markdown
Member Author

@jorgsowa I suppose we can, I didn't do it because it would tie the test to fpm although the issue is not related to fpm at all. Feel free to submit that as a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in FPM test gh13563-conf-bool-env.phpt

3 participants