Skip to content
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

redundant return code check #164

Open
leeriorio opened this issue Sep 11, 2024 · 1 comment
Open

redundant return code check #164

leeriorio opened this issue Sep 11, 2024 · 1 comment

Comments

@leeriorio
Copy link

In result of static analyse of nginx sources (including headers-more-nginx-module) with Svace static analyzer I found minor error of cathegory "REDUNDANT_COMPARISON.ALWAYS_FALSE" in ngx_http_headers_more_filter_module.c.

if (multi_http_blocks || hmcf->requires_filter) {
rc = ngx_http_headers_more_filter_init(cf);
if (rc != NGX_OK) {
return rc;
}
}

calling function ngx_http_headers_more_filter_init returns NGX_OK code only. Is it correct to check it there?

@zhuizhuhaomeng
Copy link
Contributor

Yes, we should check it here in case the ngx_http_headers_more_filter_init() returns other code in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants