diff --git a/NEWS b/NEWS index ed92a4588de..80d74f373a1 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,9 @@ PHP NEWS deprecation and TidyInternalCategory being available later than tidyOptGetCategory. (arjendekorte) +- Zip: + . Fix memory leak in zip when encountering empty glob result. (nielsdos) + 28 Aug 2025, PHP 8.3.25 - Core: diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 3710b304c35..9f1d296336e 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -668,7 +668,6 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v can be used for simple glob() calls without further error checking. */ - array_init(return_value); return 0; } #endif @@ -677,7 +676,6 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { - array_init(return_value); return 0; }