mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
Fixed memory leak (Nuno)
This commit is contained in:
@@ -2785,9 +2785,13 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
|
||||
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_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
|
||||
}
|
||||
}
|
||||
free(state.cwd);
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
|
||||
@@ -1970,9 +1970,13 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
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 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
|
||||
}
|
||||
}
|
||||
free(state.cwd);
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
@@ -4503,9 +4506,13 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
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 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
|
||||
}
|
||||
}
|
||||
free(state.cwd);
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
@@ -7618,9 +7624,13 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
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 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
|
||||
}
|
||||
}
|
||||
free(state.cwd);
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
@@ -19649,9 +19658,13 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
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 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
|
||||
}
|
||||
}
|
||||
free(state.cwd);
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
|
||||
Reference in New Issue
Block a user