]> granicus.if.org Git - php/commitdiff
- MFH: Fixed memory leak.
authorFelipe Pena <felipe@php.net>
Wed, 30 Jul 2008 19:34:23 +0000 (19:34 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 30 Jul 2008 19:34:23 +0000 (19:34 +0000)
  # Test: locale_filter_matches(str_repeat('a', 520), str_repeat('a', 520), 1);

ext/intl/locale/locale_methods.c

index 1584f54c1dc3bdc0b66e0556a8ba3e9701203a5e..82be41b061efc57b80ab9f7d8598a52008102259 100755 (executable)
@@ -1297,7 +1297,7 @@ PHP_FUNCTION(locale_filter_matches)
                }
 
                //Convert to lower case for case-insensitive comparison
-               cur_lang_tag = ecalloc( 1, strlen(lang_tag ) + 1);
+               cur_lang_tag = ecalloc( 1, strlen(can_lang_tag) + 1);
 
                //Convert to lower case for case-insensitive comparison
                result = strToMatch( can_lang_tag , cur_lang_tag);
@@ -1307,7 +1307,7 @@ PHP_FUNCTION(locale_filter_matches)
                        RETURN_FALSE;
                }
 
-               cur_loc_range = ecalloc( 1, strlen(loc_range ) + 1);
+               cur_loc_range = ecalloc( 1, strlen(can_loc_range) + 1);
                result = strToMatch( can_loc_range , cur_loc_range );
                if( result == 0) {
                        efree( cur_lang_tag );