ID: 36492 Updated by: [EMAIL PROTECTED] Reported By: sqchen at citiz dot net Status: Assigned Bug Type: Streams related Operating System: redhat 7.3 PHP Version: 5.1.2 -Assigned To: wez +Assigned To: pollita New Comment:
assigned to the other maintainer Previous Comments: ------------------------------------------------------------------------ [2006-02-23 14:44:59] [EMAIL PROTECTED] Assigned to the maintainer. ------------------------------------------------------------------------ [2006-02-23 06:56:46] sqchen at citiz dot net I think it is actully stream_filter_append() function cause memory leaks, attention: php-5.1.1 will not cause memory leaks, I have compare the source code of php-5.1.1 with php-5.1.2, and I found there are only little difference in ~\main\streams\filter.c line 207-208. " if (brigade->tail == bucket) { return; " php-5.1.1 have not, bug php-5.1.2 have. ------------------------------------------------------------------------ [2006-02-23 06:33:56] sqchen at citiz dot net Description: ------------ stream_filter_register cause memory leaks when the php version is 5.1.2 and add --enable-debug parameter Reproduce code: --------------- <?php class strtolower_filter extends php_user_filter{} stream_filter_register("strtolower", "strtolower_filter"); $fp = fopen("foo-bar.txt", "w"); stream_filter_append($fp, "strtolower"); fwrite($fp, "Line1\n"); fwrite($fp, "WORD - 2\n"); fwrite($fp, "Easy As 123\n"); fclose($fp); readfile("foo-bar.txt"); ?> Actual result: -------------- [Thu Feb 23 13:32:38 2006] Script: 'stream_filter_register.php' /home/sqchen/sqchen/php-5.1.2/main/streams/filter.c(78) : Freeing 0x083EEC14 (32 bytes), script=stream_filter_register.php Last leak repeated 2 times === Total 3 memory leaks detected === ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36492&edit=1