From: Willy Tarreau Date: Wed, 5 Sep 2018 13:49:01 +0000 (+0200) Subject: MINOR: log: use NULL for the unique_id if there is no stream X-Git-Tag: v1.9-dev2~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02fdf4f77b3ccc9604d6db373cfb7906a50d199e;p=thirdparty%2Fhaproxy.git MINOR: log: use NULL for the unique_id if there is no stream Now s->unique_id is used as NULL (not set) if s==NULL. --- diff --git a/src/log.c b/src/log.c index 19b448f3cb..f2a0679d3c 100644 --- a/src/log.c +++ b/src/log.c @@ -2504,7 +2504,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t case LOG_FMT_UNIQUEID: // %ID ret = NULL; - src = s->unique_id; + src = s ? s->unique_id : NULL; ret = lf_text(tmplog, src, maxsize - (tmplog - dst), tmp); if (ret == NULL) goto out;