]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: stats: remove build warnings on potential null-derefs
authorWilly Tarreau <w@1wt.eu>
Thu, 20 Sep 2018 09:01:01 +0000 (11:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Sep 2018 09:42:15 +0000 (11:42 +0200)
A couple of objt_appctx() could be replaced with their unchecked
equivalent since the pointer is guaranteed and not checked there.

src/stats.c

index da960f5c9d8f1fd2d0d8d437e70fba71ed0fdcfe..efa5c090c33ed672a32df28f7dc68723193ec16b 100644 (file)
@@ -2951,7 +2951,7 @@ static int stats_send_http_headers(struct stream_interface *si)
 {
        struct stream *s = si_strm(si);
        struct uri_auth *uri = s->be->uri_auth;
-       struct appctx *appctx = objt_appctx(si->end);
+       struct appctx *appctx = __objt_appctx(si->end);
 
        chunk_printf(&trash,
                     "HTTP/1.1 200 OK\r\n"
@@ -2984,7 +2984,7 @@ static int stats_send_http_redirect(struct stream_interface *si)
        char scope_txt[STAT_SCOPE_TXT_MAXLEN + sizeof STAT_SCOPE_PATTERN];
        struct stream *s = si_strm(si);
        struct uri_auth *uri = s->be->uri_auth;
-       struct appctx *appctx = objt_appctx(si->end);
+       struct appctx *appctx = __objt_appctx(si->end);
 
        /* scope_txt = search pattern + search query, appctx->ctx.stats.scope_len is always <= STAT_SCOPE_TXT_MAXLEN */
        scope_txt[0] = 0;