From 7bc813596dd36e144607609a6577d1629f2737cc Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Wed, 21 Jan 2015 17:04:49 +0100 Subject: [PATCH] Fixed missing refcount increment --- php_uv.c | 2 +- tests/320-fs-sendfile.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php_uv.c b/php_uv.c index a14737f..04fcf0b 100644 --- a/php_uv.c +++ b/php_uv.c @@ -173,7 +173,7 @@ #define PHP_UV_LOCK_MUTEX_P(resource) &resource->lock.mutex #define PHP_UV_LOCK_SEM_P(resource) &resource->lock.semaphore -#define PHP_UV_FD_TO_ZVAL(zv, fd) { php_stream *_stream = php_stream_fopen_from_fd(fd, "w+", NULL); zval *_z = (zv); php_stream_to_zval(_stream, _z); } +#define PHP_UV_FD_TO_ZVAL(zv, fd) { php_stream *_stream = php_stream_fopen_from_fd(fd, "w+", NULL); zval *_z = (zv); php_stream_to_zval(_stream, _z); Z_ADDREF_P(_z); } #if PHP_UV_DEBUG>=1 #define PHP_UV_DEBUG_PRINT(format, ...) fprintf(stderr, format, ## __VA_ARGS__) diff --git a/tests/320-fs-sendfile.phpt b/tests/320-fs-sendfile.phpt index f8652d8..b8935c1 100644 --- a/tests/320-fs-sendfile.phpt +++ b/tests/320-fs-sendfile.phpt @@ -5,7 +5,7 @@ Check for fs_send_file define("FIXTURE_PATH", dirname(__FILE__) . "/fixtures/hello.data"); uv_fs_open(uv_default_loop(), FIXTURE_PATH, UV::O_RDONLY, 0, function($read_fd) { - $std_err = STDERR; // phpt doesn't catch stdout as uv_fs_sendfile uses stdout directly. + $std_err = STDOUT; // phpt doesn't catch stdout as uv_fs_sendfile uses stdout directly. uv_fs_sendfile(uv_default_loop(), $std_err, $read_fd, 0, 6, function($result) { }); });