]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: http-ana: Remove useless test on txn when the error message is retrieved
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Jan 2020 09:13:03 +0000 (10:13 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Jan 2020 10:12:37 +0000 (11:12 +0100)
In http_error_message(), the HTTP txn is always defined. So, this is no reason
to test its nullity.

This patch partially fixes the issue #457.

src/http_ana.c

index 82a9e14a26ad93a6b935b7179e361ea7d3ca94f2..23db04ece5941526746bc559d839a2a57566abaf 100644 (file)
@@ -4603,7 +4603,7 @@ struct buffer *http_error_message(struct stream *s)
 {
        const int msgnum = http_get_status_idx(s->txn->status);
 
-       if (s->txn && s->txn->errmsg)
+       if (s->txn->errmsg)
                return s->txn->errmsg;
        else if (s->be->errmsg[msgnum])
                return s->be->errmsg[msgnum];