Redundant check in cookie_output() #695

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


None yet

1 participant


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

  if((NULL == c) || (0 == c->numcookies))
    return 0;
 /* 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 added a commit that closed this issue Mar 3, 2016
@bagder bagder cookie: remove redundant check
... as it was already checked previously within the function.

Reported-by: Dmitry-Me
Closes #695
@bagder bagder closed this in 33a0a92 Mar 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment