Skip to content

Commit b2e0077

Browse files
committed
- MFH: Fixed memory leak.
# Test: locale_filter_matches(str_repeat('a', 520), str_repeat('a', 520), 1);
1 parent b5e2564 commit b2e0077

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: ext/intl/locale/locale_methods.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ PHP_FUNCTION(locale_filter_matches)
12971297
}
12981298

12991299
//Convert to lower case for case-insensitive comparison
1300-
cur_lang_tag = ecalloc( 1, strlen(lang_tag ) + 1);
1300+
cur_lang_tag = ecalloc( 1, strlen(can_lang_tag) + 1);
13011301

13021302
//Convert to lower case for case-insensitive comparison
13031303
result = strToMatch( can_lang_tag , cur_lang_tag);
@@ -1307,7 +1307,7 @@ PHP_FUNCTION(locale_filter_matches)
13071307
RETURN_FALSE;
13081308
}
13091309

1310-
cur_loc_range = ecalloc( 1, strlen(loc_range ) + 1);
1310+
cur_loc_range = ecalloc( 1, strlen(can_loc_range) + 1);
13111311
result = strToMatch( can_loc_range , cur_loc_range );
13121312
if( result == 0) {
13131313
efree( cur_lang_tag );

0 commit comments

Comments
 (0)