Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos 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.

@nielsdos nielsdos 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
Member

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

@nielsdos
Copy link
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
Member

Makes sense thx.

@nielsdos nielsdos closed this in 056bec7 Jun 28, 2024
@jorgsowa
Copy link
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

@nielsdos
Copy link
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