cvs: ZendEngine2(PHP_5_2) / zend_builtin_functions.c zend_vm_execute.h

[email protected] ("Dmitry Stogov")
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1203439144@cvsserver>
dmitry		Tue Feb 19 16:39:04 2008 UTC

  Modified files:              (Branch: PHP_5_2)
    /ZendEngine2	zend_builtin_functions.c zend_vm_execute.h 
  Log:
  Fixed memory leaks
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.277.2.12.2.27&r2=1.277.2.12.2.28&diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.27 ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.28
--- ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.27	Fri Feb 15 07:44:45 2008
+++ ZendEngine2/zend_builtin_functions.c	Tue Feb 19 16:39:02 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.27 2008/02/15 07:44:45 dmitry Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.28 2008/02/19 16:39:02 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_API.h"
@@ -1218,6 +1218,7 @@
 		had_orig_error_handler = 1;
 		*return_value = *EG(user_error_handler);
 		zval_copy_ctor(return_value);
+		INIT_PZVAL(return_value);
 		zend_stack_push(&EG(user_error_handlers_error_reporting), &EG(user_error_handler_error_reporting), sizeof(EG(user_error_handler_error_reporting)));
 		zend_ptr_stack_push(&EG(user_error_handlers), EG(user_error_handler));
 	}
@@ -1232,6 +1233,7 @@
 	EG(user_error_handler_error_reporting) = (int)error_type;
 	*EG(user_error_handler) = *error_handler;
 	zval_copy_ctor(EG(user_error_handler));
+	INIT_PZVAL(EG(user_error_handler));
 
 	if (!had_orig_error_handler) {
 		RETURN_NULL();
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.30.2.55&r2=1.62.2.30.2.56&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.55 ZendEngine2/zend_vm_execute.h:1.62.2.30.2.56
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.55	Mon Dec 31 07:20:03 2007
+++ ZendEngine2/zend_vm_execute.h	Tue Feb 19 16:39:02 2008
@@ -181,6 +181,13 @@
 
 		ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
 		INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr));
+if (strcmp(EX(function_state).function->common.function_name, "set_error_handler") == 0) {
+static n = 0;
+++n;
+if (n>=542) {
+fprintf(stderr, "%3d 0x%08X %s\n", n, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.function_name);
+}
+}
 
 		if (EX(function_state).function->common.arg_info) {
 			zend_uint i=0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.