Skip to content

Commit b911351

Browse files
committed
Use seperate CE var
1 parent 9925f50 commit b911351

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

main/streams/userspace.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,15 +467,17 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char
467467
PHP_FUNCTION(stream_wrapper_register)
468468
{
469469
zend_string *protocol;
470-
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper *)ecalloc(1, sizeof(*uwrap));;
470+
struct php_user_stream_wrapper *uwrap;
471+
zend_class_entry *ce = NULL;
471472
zend_resource *rsrc;
472473
zend_long flags = 0;
473474

474-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SC|l", &protocol, &uwrap->ce, &flags) == FAILURE) {
475-
efree(uwrap);
475+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SC|l", &protocol, &ce, &flags) == FAILURE) {
476476
RETURN_THROWS();
477477
}
478478

479+
uwrap = (struct php_user_stream_wrapper *)ecalloc(1, sizeof(*uwrap));
480+
uwrap->ce = ce;
479481
uwrap->protoname = estrndup(ZSTR_VAL(protocol), ZSTR_LEN(protocol));
480482
uwrap->wrapper.wops = &user_stream_wops;
481483
uwrap->wrapper.abstract = uwrap;

0 commit comments

Comments
 (0)