Skip to content

Commit 28ce1b0

Browse files
committed
intl: Fix memory leak on error in locale_filter_matches()
Closes phpGH-20207.
1 parent 5fd73b5 commit 28ce1b0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ PHP NEWS
2323
. Fixed bug GH-20070 (Return type violation in imagefilter when an invalid
2424
filter is provided). (Girgias)
2525

26+
- Intl:
27+
. Fix memory leak on error in locale_filter_matches(). (nielsdos)
28+
2629
- LibXML:
2730
. Fix not thread safe schema/relaxng calls. (SpencerMalone, nielsdos)
2831

ext/intl/locale/locale_methods.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,7 @@ PHP_FUNCTION(locale_filter_matches)
13011301
/* canonicalize lang_tag */
13021302
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
13031303
if( result <=0) {
1304+
zend_string_release_ex( can_loc_range, false );
13041305
intl_error_set( NULL, status,
13051306
"locale_filter_matches : unable to canonicalize lang_tag" , 0 );
13061307
RETURN_FALSE;

0 commit comments

Comments
 (0)