diff options
author | Xinchen Hui <laruence@gmail.com> | 2014-03-07 16:49:01 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2014-03-07 16:49:01 +0800 |
commit | c2933c234c74889f8b75a20e25d7fa7df54fb821 (patch) | |
tree | 23f5aabb4535daeb0cc5dbdc907bcaf9580dd160 | |
parent | 7c623c0e89e2e5798bc40e3cb48e4151f2eab1ca (diff) | |
download | php-git-c2933c234c74889f8b75a20e25d7fa7df54fb821.tar.gz |
Fixed invalid pointer usage (tests/output/ob_start_callbacks.phpt)
-rw-r--r-- | main/output.c | 5 | ||||
-rw-r--r-- | main/php_output.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/main/output.c b/main/output.c index e9a816d44c..a25a326e16 100644 --- a/main/output.c +++ b/main/output.c @@ -495,8 +495,7 @@ PHPAPI php_output_handler *php_output_handler_create_user(zval *output_handler, user = ecalloc(1, sizeof(php_output_handler_user_func_t)); if (SUCCESS == zend_fcall_info_init(output_handler, 0, &user->fci, &user->fcc, &handler_name, &error TSRMLS_CC)) { handler = php_output_handler_init(handler_name->val, handler_name->len, chunk_size, (flags & ~0xf) | PHP_OUTPUT_HANDLER_USER TSRMLS_CC); - if (Z_REFCOUNTED_P(output_handler)) Z_ADDREF_P(output_handler); - user->zoh = output_handler; + ZVAL_COPY(&user->zoh, output_handler); handler->func.user = user; } else { efree(user); @@ -709,7 +708,7 @@ PHPAPI void php_output_handler_dtor(php_output_handler *handler TSRMLS_DC) //??? STR_FREE(handler->buffer.data); if (handler->buffer.data) efree(handler->buffer.data); if (handler->flags & PHP_OUTPUT_HANDLER_USER) { - zval_ptr_dtor(handler->func.user->zoh); + zval_ptr_dtor(&handler->func.user->zoh); efree(handler->func.user); } if (handler->dtor && handler->opaq) { diff --git a/main/php_output.h b/main/php_output.h index e61b59b95a..45af14f6a5 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -123,7 +123,7 @@ typedef struct _php_output_handler *(*php_output_handler_alias_ctor_t)(const cha typedef struct _php_output_handler_user_func_t { zend_fcall_info fci; zend_fcall_info_cache fcc; - zval *zoh; + zval zoh; } php_output_handler_user_func_t; typedef struct _php_output_handler { |