summaryrefslogtreecommitdiff
path: root/ext/standard/basic_functions.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-09-15 09:12:17 +0000
committerAntony Dovgal <tony2001@php.net>2006-09-15 09:12:17 +0000
commit04da0582846db07dde5b6e5242ca80df9ea109cf (patch)
tree36c399c6aa85c28ccac0aa7b740edcacfb5affe8 /ext/standard/basic_functions.c
parent4b257a1c0e4af80a162727789e595b6d77e136ae (diff)
downloadphp-git-04da0582846db07dde5b6e5242ca80df9ea109cf.tar.gz
MFH: fix leak when call to shutdown function fails
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r--ext/standard/basic_functions.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index f59920f1b4..236fbd0106 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -5224,18 +5224,20 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun
if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name)) {
php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name);
- } else if (call_user_function(EG(function_table), NULL,
- shutdown_function_entry->arguments[0],
- &retval,
- shutdown_function_entry->arg_count - 1,
- shutdown_function_entry->arguments + 1
- TSRMLS_CC ) == SUCCESS)
+ efree(function_name);
+ return 0;
+ }
+ efree(function_name);
+
+ if (call_user_function(EG(function_table), NULL,
+ shutdown_function_entry->arguments[0],
+ &retval,
+ shutdown_function_entry->arg_count - 1,
+ shutdown_function_entry->arguments + 1
+ TSRMLS_CC ) == SUCCESS)
{
zval_dtor(&retval);
}
- if (function_name) {
- efree(function_name);
- }
return 0;
}