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 check in cookie_output() #695

Closed
Dmitry-Me opened this Issue Mar 2, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@Dmitry-Me

Dmitry-Me commented Mar 2, 2016

cookie.c contains cookie_output() which caused a false positive in Cppcheck. Code goes like this:

  if((NULL == c) || (0 == c->numcookies))
    return 0;
  remove_expired(c);
 /* WHATEVER, doesn't change c */

  if(c) { /* WHATEVER */

The if(c) is redundant - if c is NULL then control never gets to the if.

@bagder bagder closed this in 33a0a92 Mar 3, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.