Skip to content

Commit 0236bbc

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #80958
2 parents 4381895 + ecc4bf1 commit 0236bbc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/standard/string.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4700,9 +4700,13 @@ static zend_string *try_setlocale_str(zend_long cat, zend_string *loc) {
47004700
}
47014701

47024702
static zend_string *try_setlocale_zval(zend_long cat, zval *loc_zv) {
4703-
zend_string *loc_str = zval_try_get_string(loc_zv);
4703+
zend_string *tmp_loc_str;
4704+
zend_string *loc_str = zval_try_get_tmp_string(loc_zv, &tmp_loc_str);
4705+
if (UNEXPECTED(loc_str == NULL)) {
4706+
return NULL;
4707+
}
47044708
zend_string *result = try_setlocale_str(cat, loc_str);
4705-
zend_string_release_ex(loc_str, 0);
4709+
zend_tmp_string_release(tmp_loc_str);
47064710
return result;
47074711
}
47084712

0 commit comments

Comments
 (0)