Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt
This commit is contained in:
Niels Dossche 2024-06-28 22:08:18 +02:00
commit 41371900a8
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 6 additions and 2 deletions

2
NEWS
View file

@ -6,6 +6,8 @@ PHP NEWS
. Fixed bug GH-13922 (Fixed support for systems with . Fixed bug GH-13922 (Fixed support for systems with
sysconf(_SC_GETPW_R_SIZE_MAX) == -1). (Arnaud) sysconf(_SC_GETPW_R_SIZE_MAX) == -1). (Arnaud)
. Fixed bug GH-14626 (Fix is_zend_ptr() for huge blocks). (Arnaud) . Fixed bug GH-14626 (Fix is_zend_ptr() for huge blocks). (Arnaud)
. Fixed bug GH-14590 (Memory leak in FPM test gh13563-conf-bool-env.phpt.
(nielsdos)
- Phar: - Phar:
. Fixed bug GH-14603 (null string from zip entry). . Fixed bug GH-14603 (null string from zip entry).

View file

@ -179,8 +179,10 @@ static void zend_ini_get_var(zval *result, zval *name, zval *fallback)
if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) { if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) {
ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(curval), Z_STRLEN_P(curval), ZEND_SYSTEM_INI)); ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(curval), Z_STRLEN_P(curval), ZEND_SYSTEM_INI));
/* ..or if not found, try ENV */ /* ..or if not found, try ENV */
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name))) != NULL || } else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name))) != NULL) {
(envvar = getenv(Z_STRVAL_P(name))) != NULL) { ZVAL_NEW_STR(result, zend_string_init(envvar, strlen(envvar), ZEND_SYSTEM_INI));
efree(envvar);
} else if ((envvar = getenv(Z_STRVAL_P(name))) != NULL) {
ZVAL_NEW_STR(result, zend_string_init(envvar, strlen(envvar), ZEND_SYSTEM_INI)); ZVAL_NEW_STR(result, zend_string_init(envvar, strlen(envvar), ZEND_SYSTEM_INI));
/* ..or if not defined, try fallback value */ /* ..or if not defined, try fallback value */
} else if (fallback) { } else if (fallback) {