1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/intl: Use zval_get_tmp_string where possible (#18966)

This commit is contained in:
Niels Dossche
2025-06-28 10:12:20 +02:00
committed by GitHub
parent 22e444c5c7
commit 44955943f9

View File

@@ -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