From be895bcb96157b5a36d1183d3b9567ede57a45f8 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Wed, 13 Dec 2000 22:50:10 +0000 Subject: Fix call_user_function() with objects - it could leak under certain circumstances --- ext/standard/basic_functions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/standard/basic_functions.c') diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ada3bd0d5e..5bcea01d01 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1618,7 +1618,7 @@ PHP_FUNCTION(call_user_method) SEPARATE_ZVAL(params[0]); SEPARATE_ZVAL(params[1]); convert_to_string(*params[0]); - if (call_user_function_ex(CG(function_table), *params[1], *params[0], &retval_ptr, arg_count-2, params+2, 1, NULL)==SUCCESS + if (call_user_function_ex(CG(function_table), *params[1], params[0], &retval_ptr, arg_count-2, params+2, 1, NULL)==SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { @@ -1659,7 +1659,7 @@ PHP_FUNCTION(call_user_method_array) zend_hash_move_forward(params_ar)) element++; - if (call_user_function_ex(CG(function_table), *obj, *method_name, &retval_ptr, num_elems, method_args, 1, NULL) == SUCCESS + if (call_user_function_ex(CG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 1, NULL) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { -- cgit v1.2.1