diff --git a/NEWS b/NEWS index f5d0ad47b7f..a99d0c43243 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,9 @@ PHP NEWS . Remove incorrect call to zval_ptr_dtor() in user_wrapper_metadata(). (nielsdos) +- Zip: + . Fix memory leak in zip when encountering empty glob result. (nielsdos) + 28 Aug 2025, PHP 8.4.12 - Core: diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 3d70668be1f..659dd48ae29 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -667,7 +667,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 @@ -676,7 +675,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; }