]> granicus.if.org Git - php/commitdiff
Fixed memory leak on error
authorIlia Alshanetsky <iliaa@php.net>
Thu, 27 Oct 2005 14:07:30 +0000 (14:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 27 Oct 2005 14:07:30 +0000 (14:07 +0000)
Zend/zend_API.c

index 584d7a1ec3df0b199ad1a4721f13df6b0a5b3a71..2d0b8ea16cb61f8133f7827aefa15799a0eea4ac 100644 (file)
@@ -1534,10 +1534,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;