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

ext/intl/locale/locale_methods.c

index 7ee16dd8a19f9166cd8ab8ce52504500298fd36e..ee85d104c2a821fb2116af1b3fcf6d9cd3382aed 100755 (executable)
@@ -1319,7 +1319,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);
@@ -1329,7 +1329,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 );