From 5cb482c36ad0a7a3a3c7ea20348a6b6b53f0ff85 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 28 Jun 2025 00:33:20 +0200 Subject: [PATCH] ext/intl: Use zval_get_tmp_string where possible --- ext/intl/listformatter/listformatter_class.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/intl/listformatter/listformatter_class.c b/ext/intl/listformatter/listformatter_class.c index 1fe8da554a1ca..f1a5039079b8a 100644 --- a/ext/intl/listformatter/listformatter_class.c +++ b/ext/intl/listformatter/listformatter_class.c @@ -135,9 +135,9 @@ PHP_METHOD(IntlListFormatter, format) zval *val; ZEND_HASH_FOREACH_VAL(ht, val) { - zend_string *str_val; + zend_string *str_val, *tmp_str; - str_val = zval_get_string(val); + str_val = zval_get_tmp_string(val, &tmp_str); // Convert PHP string to UTF-16 UChar *ustr = NULL; @@ -145,7 +145,7 @@ PHP_METHOD(IntlListFormatter, format) UErrorCode status = U_ZERO_ERROR; intl_convert_utf8_to_utf16(&ustr, &ustr_len, ZSTR_VAL(str_val), ZSTR_LEN(str_val), &status); - zend_string_release(str_val); + zend_tmp_string_release(tmp_str); if (U_FAILURE(status)) { // We can't use goto cleanup because items and itemLengths are incompletely allocated