For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > October 2006 > cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h
Dmitry Stogov

2006-10-03, 6:56 pm

dmitry Tue Oct 3 07:31:10 2006 UTC

Modified files:
/ZendEngine2 zend_vm_def.h zend_vm_execute.h
Log:
Fixed memory leak (Nuno)


http://cvs.php.net/viewvc.cgi/ZendE...6&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.145 ZendEngine2/zend_vm_def.h:1.146
--- ZendEngine2/zend_vm_def.h:1.145 Tue Sep 26 10:31:04 2006
+++ ZendEngine2/zend_vm_def.h Tue Oct 3 07:31:10 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_vm_def.h,v 1.145 2006/09/26 10:31:04 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.146 2006/10/03 07:31:10 dmitry Exp $ */

/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -2846,9 +2846,13 @@
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);

- if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
- zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
- failure_retval=1;
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
} else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename
), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
@@ -2868,7 +2872,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQU
IRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
http://cvs.php.net/viewvc.cgi/ZendE...0&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.149 ZendEngine2/zend_vm_execute.h:1.150
--- ZendEngine2/zend_vm_execute.h:1.149 Tue Sep 26 10:31:04 2006
+++ ZendEngine2/zend_vm_execute.h Tue Oct 3 07:31:10 2006
@@ -1948,9 +1948,13 @@
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);

- if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
- zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
- failure_retval=1;
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
} else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename
), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
@@ -1970,7 +1974,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQU
IRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
@@ -4549,9 +4552,13 @@
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);

- if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
- zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
- failure_retval=1;
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
} else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename
), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
@@ -4571,7 +4578,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQU
IRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
@@ -7747,9 +7753,13 @@
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);

- if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
- zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
- failure_retval=1;
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
} else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename
), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
@@ -7769,7 +7779,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQU
IRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
@@ -20280,9 +20289,13 @@
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);

- if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
- zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
- failure_retval=1;
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
} else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename
), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
@@ -20302,7 +20315,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQU
IRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com