]> granicus.if.org Git - php/commitdiff
- Fix leak
authorAndi Gutmans <andi@php.net>
Tue, 24 Sep 2002 19:32:01 +0000 (19:32 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 24 Sep 2002 19:32:01 +0000 (19:32 +0000)
Zend/zend_compile.c

index d4e7f4be7e37880f49f61e065b0c02dbdcf59bc2..39c0fa035da3eb6c49527d4e34adde858827bd52 100644 (file)
@@ -1678,14 +1678,14 @@ ZEND_API int do_bind_inherited_class(zend_op *opline, HashTable *function_table,
                ce = *pce;
        }
 
-       ce->refcount++;
-
        zend_do_inheritance(ce, parent_ce);
 
        if (strchr(opline->op2.u.constant.value.str.val, ':')) {
                return create_nested_class(class_table, opline->op2.u.constant.value.str.val, ce);
        }
 
+       ce->refcount++;
+
        /* Register the derived class */
        if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
                zend_error(E_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);