Skip to content

Commit

Permalink
Drop special stream code handling, as this might been needed of the d…
Browse files Browse the repository at this point in the history
…ouble free issue
  • Loading branch information
Girgias committed Jul 31, 2020
1 parent 2732dac commit 15ae608
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions main/streams/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <stddef.h>
#include <fcntl.h>
#include "php_streams_int.h"
#include "Zend/zend_exceptions.h"

/* {{{ resource and registration code */
/* Global wrapper hash, copied to FG(stream_wrappers) on registration of volatile wrapper */
Expand Down Expand Up @@ -211,18 +210,8 @@ void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *
msg = "no suitable wrapper could be found";
}

/* To handle throw_on_error declare statement */
zend_execute_data *ex = EG(current_execute_data);
/* Find first non internal execute_data */
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
ex = ex->prev_execute_data;
}
if ((ex->func->common.fn_flags & ZEND_ACC_THROW_WARNING) != 0) {
zend_throw_exception_ex(zend_ce_exception, E_WARNING, "%s: %s", caption, msg);
} else {
php_strip_url_passwd(tmp);
php_error_docref1(NULL, tmp, E_WARNING, "%s: %s", caption, msg);
}
php_strip_url_passwd(tmp);
php_error_docref1(NULL, tmp, E_WARNING, "%s: %s", caption, msg);
efree(tmp);
if (free_msg) {
efree(msg);
Expand Down

0 comments on commit 15ae608

Please sign in to comment.