fix #34. forget to initialize zval

This commit is contained in:
Shuhei Tanuma 2013-02-27 00:22:13 +09:00
parent 105841efb6
commit 0a7cb9757c
2 changed files with 20 additions and 0 deletions

View File

@ -1717,6 +1717,9 @@ static void php_uv_fs_cb(uv_fs_t* req)
zval *buffer;
if (req && req->ptr) {
buffer = php_uv_make_stat((const uv_statbuf_t*)req->ptr);
} else {
MAKE_STD_ZVAL(buffer);
ZVAL_NULL(buffer);
}
params[1] = &buffer;
break;

View File

@ -0,0 +1,17 @@
--TEST--
Check for #14
--FILE--
<?php
$loop = uv_default_loop();
$filename ="does_not_exist.txt";
uv_fs_stat($loop, $filename, function ($result, $stat) {
echo $result . PHP_EOL;
if (is_null($stat)) {
echo "NULL" . PHP_EOL;
}
});
uv_run();
--EXPECT--
-1
NULL