From ed379f738f9152bd9d004bb8f9c7d92c3fa65561 Mon Sep 17 00:00:00 2001 From: Shuhei Tanuma Date: Thu, 19 Jul 2012 23:09:34 +0900 Subject: [PATCH] check loop resource type --- php_uv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/php_uv.c b/php_uv.c index 4a57523..052eb27 100644 --- a/php_uv.c +++ b/php_uv.c @@ -37,13 +37,13 @@ } #define PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop) \ - { \ - if (zloop != NULL) { \ - ZEND_FETCH_RESOURCE(loop, uv_loop_t*, &zloop, -1, PHP_UV_LOOP_RESOURCE_NAME, uv_loop_handle); \ - } else { \ - loop = uv_default_loop(); \ - } \ - } + if (zloop != NULL) { \ + if(!ZEND_FETCH_RESOURCE_NO_RETURN(loop, uv_loop_t*, &zloop, -1, PHP_UV_LOOP_RESOURCE_NAME, uv_loop_handle)){\ + RETURN_FALSE; \ + }\ + } else { \ + loop = uv_default_loop(); \ + } \ #define PHP_UV_ZVAL_TO_FD(fd, zstream) \ { \