dmitry Tue Oct 3 07:30:47 2006 UTC
Modified files: (Branch: PHP_5_2)
/ZendEngine2 zend_vm_def.h zend_vm_execute.h
Log:
Fixed memory leak (Nuno)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.29.2.29&r2=1.59.2.29.2.30&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.29
ZendEngine2/zend_vm_def.h:1.59.2.29.2.30
--- ZendEngine2/zend_vm_def.h:1.59.2.29.2.29 Tue Sep 26 10:30:50 2006
+++ ZendEngine2/zend_vm_def.h Tue Oct 3 07:30:45 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.59.2.29.2.29 2006/09/26 10:30:50 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.30 2006/10/03 07:30:45 dmitry Exp $ */
/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -2785,9 +2785,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) {
@@ -2808,7 +2812,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.30.2.29&r2=1.62.2.30.2.30&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.29
ZendEngine2/zend_vm_execute.h:1.62.2.30.2.30
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.29 Tue Sep 26 10:30:50 2006
+++ ZendEngine2/zend_vm_execute.h Tue Oct 3 07:30:46 2006
@@ -1970,9 +1970,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) {
@@ -1993,7 +1997,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
@@ -4503,9 +4506,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) {
@@ -4526,7 +4533,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
@@ -7618,9 +7624,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) {
@@ -7641,7 +7651,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
@@ -19649,9 +19658,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) {
@@ -19672,7 +19685,6 @@
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- free(state.cwd);
}
break;
case ZEND_INCLUDE:
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|