[pull] master from php:master#853
Merged
pull[bot] merged 8 commits intoturkdevops:masterfrom Apr 10, 2026
Merged
Conversation
…gument of `scandir()` (#19373)
globfree was not called on the no-matches path and on the open_basedir reject path, leaking the glob_t contents populated by a successful glob() call. close GH-21702
* PHP-8.4: Fix GH-21698: memory leak in ZipArchive::addGlob on early returns.
* PHP-8.5: Fix GH-21698: memory leak in ZipArchive::addGlob on early returns.
GH-21702 added two `globfree()` calls at the no-match and open_basedir reject paths, but called `globfree` directly instead of the `php_globfree` wrapper used at the success path below. PHP-8.5 dropped the direct `<glob.h>` include from `ext/zip/php_zip.c` in favor of the `php_glob.h` wrapper, so the build now breaks with `-Werror=implicit-function-declaration` on systems where `<glob.h>` isn't transitively included. Match the existing wrapper usage at line 675. close GH-21709
* PHP-8.5: Fix build: use php_globfree wrapper in ZipArchive::addGlob early returns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )