]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: backend: remove useless test for inexistent connection
authorWilly Tarreau <w@1wt.eu>
Thu, 23 Jan 2020 10:36:33 +0000 (11:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 Jan 2020 10:37:43 +0000 (11:37 +0100)
Coverity rightfully reported that it's pointless to test for "conn"
to be null while all code paths leading to it have already
dereferenced it. This addresses issue #461.

src/backend.c

index 7a75ed3c651abeec614911fb0c535d9c7424d17d..859a004264b9c7cf5f9a156cc57251f88fdcdea0 100644 (file)
@@ -1956,7 +1956,7 @@ void back_handle_st_con(struct stream *s)
  done:
        /* retryable error ? */
        if (si->flags & (SI_FL_EXP|SI_FL_ERR)) {
-               if (!(s->flags & SF_SRV_REUSED) && conn) {
+               if (!(s->flags & SF_SRV_REUSED)) {
                        conn_stop_tracking(conn);
                        conn_full_close(conn);
                }