From: Christopher Faulet Date: Wed, 8 Jun 2022 07:06:15 +0000 (+0200) Subject: BUG/MINOR: trace: Test server existence for health-checks to get proxy X-Git-Tag: v2.7-dev1~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3b257479652bf148944571e8aca7beafd5afd65;p=thirdparty%2Fhaproxy.git BUG/MINOR: trace: Test server existence for health-checks to get proxy Email alerts are based on health-checks but with no server. Thus, in __trace() function, responsible to write a trace message, we must be prepared to have no server and thus no proxy. This patch must be backported as far as 2.4. --- diff --git a/src/trace.c b/src/trace.c index 541acf2132..5909dd438d 100644 --- a/src/trace.c +++ b/src/trace.c @@ -144,7 +144,7 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src, } if (check) { srv = check->server; - be = srv->proxy; + be = (srv ? srv->proxy : NULL); } if (!srv && conn)