]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: use NULL for the unique_id if there is no stream
authorWilly Tarreau <w@1wt.eu>
Wed, 5 Sep 2018 13:49:01 +0000 (15:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Sep 2018 18:01:23 +0000 (20:01 +0200)
Now s->unique_id is used as NULL (not set) if s==NULL.

src/log.c

index 19b448f3cb0a2f6495c8aa527e6de3eedf2abf4a..f2a0679d3cb8cda7a0ccc40f9a5f386e72af7f39 100644 (file)
--- 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;