]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: queue: Remove useless tests on p or pp in pendconn_process_next_strm()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 Feb 2021 10:13:33 +0000 (11:13 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 Feb 2021 10:48:36 +0000 (11:48 +0100)
This patch removes unecessary tests on p or pp pointers in
pendconn_process_next_strm() function. This should make cppcheck happy and
avoid false report of null pointer dereference.

This patch should fix the issue #1036.

src/queue.c

index 19b99a5f6045ad97b14d08b0066998c9775968e1..8157809392b09326c1ea1084572929dbbdcd8718 100644 (file)
@@ -281,12 +281,12 @@ static int pendconn_process_next_strm(struct server *srv, struct proxy *px)
 
        if (!p && !pp)
                return 0;
+       else if (!pp)
+               goto use_p; /*  p != NULL */
+       else if (!p)
+               goto use_pp; /* pp != NULL */
 
-       if (p && !pp)
-               goto use_p;
-
-       if (pp && !p)
-               goto use_pp;
+       /* p != NULL && pp != NULL*/
 
        if (KEY_CLASS(p->node.key) < KEY_CLASS(pp->node.key))
                goto use_p;