From fa2e7ba0cb5230e7fb02da0e0b1726e468f270ce Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sat, 29 Mar 2014 20:17:59 +0800 Subject: [PATCH] Fixed retval for ps_call_handler --- ext/session/mod_user.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 4e42a1ba14..2b4e79996f 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -50,7 +50,12 @@ ps_module ps_mod_user = { static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRMLS_DC) { int i; - call_user_function(EG(function_table), NULL, func, retval, argc, argv TSRMLS_CC); + if (call_user_function(EG(function_table), NULL, func, retval, argc, argv TSRMLS_CC) == FAILURE) { + zval_ptr_dtor(retval); + ZVAL_UNDEF(retval); + } else if (ZVAL_IS_UNDEF(retval)) { + ZVAL_NULL(retval); + } for (i = 0; i < argc; i++) { zval_ptr_dtor(&argv[i]); } -- 2.50.1