]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: http: remove a useless null check
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 00:25:25 +0000 (01:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 15:19:18 +0000 (16:19 +0100)
srv cannot be null in http_perform_server_redirect(), as it's taken
from the stream interface's target which is always valid for a
server-based redirect, and it was already dereferenced above, so in
practice, gcc already removes the test anyway.

Reported-by: Dinko Korunic <dkorunic@reflected.net>
src/proto_http.c

index 2a88fe0aca4ba7d308d685a61523432537a27d09..3d68da89dde941b83f2f88b9b27ade0b60219ad7 100644 (file)
@@ -817,8 +817,7 @@ void http_perform_server_redirect(struct session *s, struct stream_interface *si
        http_server_error(s, si, SN_ERR_PRXCOND, SN_FINST_C, 302, &trash);
 
        /* FIXME: we should increase a counter of redirects per server and per backend. */
-       if (srv)
-               srv_inc_sess_ctr(srv);
+       srv_inc_sess_ctr(srv);
 }
 
 /* Return the error message corresponding to si->err_type. It is assumed