Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix memory leak in lookup_loc_range()
This commit is contained in:
Niels Dossche 2025-06-01 11:38:51 +02:00
commit cb0b2a27e3
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 2 additions and 0 deletions

1
NEWS
View file

@ -24,6 +24,7 @@ PHP NEWS
- Intl: - Intl:
. Fix memory leak in intl_datetime_decompose() on failure. (nielsdos) . Fix memory leak in intl_datetime_decompose() on failure. (nielsdos)
. Fix memory leak in locale lookup on failure. (nielsdos)
- Phar: - Phar:
. Add missing filter cleanups on phar failure. (nielsdos) . Add missing filter cleanups on phar failure. (nielsdos)

View file

@ -1488,6 +1488,7 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr,
zend_string_release_ex(can_loc_range, 0); zend_string_release_ex(can_loc_range, 0);
} }
if(result == 0) { if(result == 0) {
efree(cur_loc_range);
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0); intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL); LOOKUP_CLEAN_RETURN(NULL);
} }