From cbeef6084b8615298118c13db3fea6adda4105cb Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 27 Oct 2005 14:14:33 +0000 Subject: [PATCH] MFB51: Fixed memory leak on error --- Zend/zend_API.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 37dd1a630a..52365e0c47 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2105,10 +2105,14 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr } } else { if (scope && (scope->ce_flags & ZEND_ACC_INTERFACE)) { + efree(lc_class_name); zend_error(error_type, "Interface %s cannot contain non abstract method %s()", scope->name, ptr->fname); return FAILURE; } if (!internal_function->handler) { + if (scope) { + efree(lc_class_name); + } zend_error(error_type, "Method %s%s%s() cannot be a NULL function", scope ? scope->name : "", scope ? "::" : "", ptr->fname); zend_unregister_functions(functions, count, target_function_table TSRMLS_CC); return FAILURE; -- 2.40.0