From: Felipe Pena Date: Tue, 22 Nov 2011 12:47:08 +0000 (+0000) Subject: - Fixed invalid free in call_user_method() function X-Git-Tag: php-5.5.0alpha1~841 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97d7f9e11213a5d290cd5b76842454cc9e1f6530;p=php - Fixed invalid free in call_user_method() function --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 3e65c02427..0068b96e90 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4797,7 +4797,9 @@ PHP_FUNCTION(call_user_method) Z_TYPE_P(object) != IS_STRING ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name"); - efree(params); + if (params) { + efree(params); + } RETURN_FALSE; } diff --git a/ext/standard/tests/general_functions/call_user_method_002.phpt b/ext/standard/tests/general_functions/call_user_method_002.phpt new file mode 100644 index 0000000000..054bc3edeb --- /dev/null +++ b/ext/standard/tests/general_functions/call_user_method_002.phpt @@ -0,0 +1,12 @@ +--TEST-- +call_user_method() Invalid free +--FILE-- + +--EXPECTF-- +Deprecated: Function call_user_method() is deprecated in %s on line %d + +Warning: call_user_method(): Second argument is not an object or class name in %s on line %d