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

intl: Fix memory leak on error in locale_filter_matches()

Closes GH-20207.
This commit is contained in:
Niels Dossche
2025-10-17 22:54:04 +02:00
parent 5fd73b55a7
commit 28ce1b04ef
2 changed files with 4 additions and 0 deletions

3
NEWS
View File

@@ -23,6 +23,9 @@ PHP NEWS
. Fixed bug GH-20070 (Return type violation in imagefilter when an invalid
filter is provided). (Girgias)
- Intl:
. Fix memory leak on error in locale_filter_matches(). (nielsdos)
- LibXML:
. Fix not thread safe schema/relaxng calls. (SpencerMalone, nielsdos)

View File

@@ -1301,6 +1301,7 @@ PHP_FUNCTION(locale_filter_matches)
/* canonicalize lang_tag */
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
if( result <=0) {
zend_string_release_ex( can_loc_range, false );
intl_error_set( NULL, status,
"locale_filter_matches : unable to canonicalize lang_tag" , 0 );
RETURN_FALSE;