From 4061a72664a61f4bc2db2f7166fcf8c21d7bb2ac Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 21 Sep 2009 11:22:13 +0000 Subject: [PATCH] Fixed memory leak --- main/output.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/main/output.c b/main/output.c index 1efaf806e7..fdf7ac4a32 100644 --- a/main/output.c +++ b/main/output.c @@ -227,8 +227,6 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS ALLOC_INIT_ZVAL(orig_buffer); ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 1); - orig_buffer->refcount=2; /* don't let call_user_function() destroy our buffer */ - orig_buffer->is_ref=1; ALLOC_INIT_ZVAL(z_status); ZVAL_LONG(z_status, status); @@ -248,11 +246,7 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS if (!just_flush) { zval_ptr_dtor(&OG(active_ob_buffer).output_handler); } - orig_buffer->refcount -=2; - if (orig_buffer->refcount <= 0) { /* free the zval */ - zval_dtor(orig_buffer); - FREE_ZVAL(orig_buffer); - } + zval_ptr_dtor(&orig_buffer); zval_ptr_dtor(&z_status); } -- 2.50.1