Hi internals,

another small patch. This time concerning
http://bugs.php.net/bug.php?id=42818. As I'm not a ZendEngine expert I'm
not sure if this is the right place and the right way to fix the bug, but
at least for me this small fix works fine. Maybe somebody who is really
into depth with the engine can use it as a small hint.

The problem is that in ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER the op
code tmp_var is initialized but never freed by the clone op handler.

patch is against PHP_5_3

greets 
 david


Index: zend_vm_execute.h
===================================================================
RCS file: /repository/ZendEngine2/zend_vm_execute.h,v
retrieving revision 1.62.2.30.2.49.2.5
diff -u -r1.62.2.30.2.49.2.5 zend_vm_execute.h
--- zend_vm_execute.h   1 Oct 2007 10:37:13 -0000       1.62.2.30.2.49.2.5
+++ zend_vm_execute.h   1 Oct 2007 23:24:33 -0000
@@ -4661,7 +4661,9 @@
                zend_error(E_WARNING, "__clone method called on non-object");
                EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
                EX_T(opline->result.u.var).var.ptr->refcount++;
-
+               if (obj) {
+                 zval_dtor(obj);
+               }
                ZEND_VM_NEXT_OPCODE();
        }

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to