]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: check; Remove some useless assignments to NULL
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 May 2023 07:25:32 +0000 (09:25 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 May 2023 07:28:23 +0000 (09:28 +0200)
In process_chk_conn(), some assignments to NULL are useless and are reported
by Coverity as unused value. while it is harmless, these assignments can be
removed.

This patch should fix the coverity report #2158.

src/check.c

index 86cd5963c76c2fd207d1dbb00de123a32dc836d0..a440185daaa331256abb9df8534797fdc17f12ce 100644 (file)
@@ -1242,7 +1242,6 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
                        if (check->state & CHK_ST_CLOSE_CONN) {
                                TRACE_DEVEL("closing current connection", CHK_EV_TASK_WAKE|CHK_EV_HCHK_RUN, check);
                                check->state &= ~CHK_ST_CLOSE_CONN;
-                               conn = NULL;
                                if (!sc_reset_endp(check->sc)) {
                                        /* error will be handled by tcpcheck_main().
                                         * On success, remove all flags except SE_FL_DETACHED
@@ -1277,8 +1276,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
 
        if (sc) {
                sc_destroy(sc);
-               sc = check->sc = NULL;
-               conn = NULL;
+               check->sc = NULL;
        }
 
        if (check->sess != NULL) {