Commit: 1eff3b01b8e2fdeadc9640ae1a19b8330277ccc5 Author: Gustavo André dos Santos Lopes <cataphr...@php.net> Wed, 23 May 2012 12:09:27 +0200 Parents: 86ea921291cd637fd0a7ffb0183625a5ac60e1ee Branches: PHP-5.3 PHP-5.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1eff3b01b8e2fdeadc9640ae1a19b8330277ccc5 Log: Fixed bug #6208: memory leak in grapheme_extract() Bugs: https://bugs.php.net/6208 Changed paths: M ext/intl/grapheme/grapheme_string.c A ext/intl/tests/bug62083.phpt Diff: diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 719015f..0b7ecdb 100755 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -818,6 +818,7 @@ PHP_FUNCTION(grapheme_extract) } else { /* initialize next */ + zval_dtor(next); ZVAL_LONG(next, lstart); } } diff --git a/ext/intl/tests/bug62083.phpt b/ext/intl/tests/bug62083.phpt new file mode 100644 index 0000000..4baa5c5 --- /dev/null +++ b/ext/intl/tests/bug62083.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #62083: grapheme_extract() leaks memory +--SKIPIF-- +<?php +if (!extension_loaded('intl')) + die('skip intl extension not enabled'); +--FILE-- +<?php +$arr1 = array(); +var_dump(grapheme_extract(-1, -1, -1,-1, $arr1)); +--EXPECT-- +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php