From 02fdf4f77b3ccc9604d6db373cfb7906a50d199e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 5 Sep 2018 15:49:01 +0200 Subject: [PATCH] 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. --- src/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 19b448f3c..f2a0679d3 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;