Skip to content

Remove dead error checks for php_stream_filter_alloc() #19194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions ext/iconv/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,6 @@ static const php_stream_filter_ops php_iconv_stream_filter_ops = {
/* {{{ php_iconv_stream_filter_create */
static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, uint8_t persistent)
{
php_stream_filter *retval = NULL;
php_iconv_stream_filter *inst;
const char *from_charset = NULL, *to_charset = NULL;
size_t from_charset_len, to_charset_len;
Expand Down Expand Up @@ -2602,12 +2601,7 @@ static php_stream_filter *php_iconv_stream_filter_factory_create(const char *nam
return NULL;
}

if (NULL == (retval = php_stream_filter_alloc(&php_iconv_stream_filter_ops, inst, persistent))) {
php_iconv_stream_filter_dtor(inst);
pefree(inst, persistent);
}

return retval;
return php_stream_filter_alloc(&php_iconv_stream_filter_ops, inst, persistent);
}
/* }}} */

Expand Down
10 changes: 2 additions & 8 deletions ext/standard/filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,6 @@ static const php_stream_filter_ops strfilter_convert_ops = {
static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, uint8_t persistent)
{
php_convert_filter *inst;
php_stream_filter *retval = NULL;

char *dot;
int conv_mode = 0;
Expand Down Expand Up @@ -1587,16 +1586,11 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval
if (php_convert_filter_ctor(inst, conv_mode,
(filterparams != NULL ? Z_ARRVAL_P(filterparams) : NULL),
filtername, persistent) != SUCCESS) {
goto out;
}

retval = php_stream_filter_alloc(&strfilter_convert_ops, inst, persistent);
out:
if (retval == NULL) {
pefree(inst, persistent);
return NULL;
}

return retval;
return php_stream_filter_alloc(&strfilter_convert_ops, inst, persistent);
}

static const php_stream_filter_factory strfilter_convert_factory = {
Expand Down
4 changes: 0 additions & 4 deletions ext/standard/user_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
}

filter = php_stream_filter_alloc(&userfilter_ops, NULL, 0);
if (filter == NULL) {
zval_ptr_dtor(&obj);
return NULL;
}

/* filtername */
add_property_string(&obj, "filtername", (char*)filtername);
Expand Down