pollita Sat Aug 4 07:51:15 2007 UTC
Modified files:
/php-src/ext/standard user_filters.c
Log:
Bugfix#36492 Userfilters can leak buckets
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/user_filters.c?r1=1.48&r2=1.49&diff_format=u
Index: php-src/ext/standard/user_filters.c
diff -u php-src/ext/standard/user_filters.c:1.48
php-src/ext/standard/user_filters.c:1.49
--- php-src/ext/standard/user_filters.c:1.48 Sat Jul 14 08:38:20 2007
+++ php-src/ext/standard/user_filters.c Sat Aug 4 07:51:15 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: user_filters.c,v 1.48 2007/07/14 08:38:20 tony2001 Exp $ */
+/* $Id: user_filters.c,v 1.49 2007/08/04 07:51:15 pollita Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -232,8 +232,21 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call
filter function");
}
- if (retval)
+ if (retval) {
zval_ptr_dtor(&retval);
+ }
+
+ if (buckets_in->head) {
+ php_stream_bucket *bucket = buckets_in->head;
+
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unprocessed filter
buckets remaining on input brigade");
+ while ((bucket = buckets_in->head)) {
+ /* Remove unconsumed buckets from the brigade */
+ php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ }
+ }
+
zval_ptr_dtor(&zclosing);
zval_ptr_dtor(&zconsumed);
zval_ptr_dtor(&zout);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php