From bc8aebdce951d30b4ca1e7e1e7d3f5e0cf468f46 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 5 Nov 2025 23:45:30 +0100 Subject: [PATCH] log-context: Don't add log context if value is NULL This avoids if conditions at the callsite which mess up stack based lifetimes. --- src/basic/log-context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/basic/log-context.c b/src/basic/log-context.c index 27bce6f1f61..334fe95fc34 100644 --- a/src/basic/log-context.c +++ b/src/basic/log-context.c @@ -58,7 +58,9 @@ static LogContext* log_context_detach(LogContext *c) { LogContext* log_context_new(const char *key, const char *value) { assert(key); assert(endswith(key, "=")); - assert(value); + + if (!value) + return NULL; LIST_FOREACH(ll, i, _log_context) if (i->key == key && i->value == value) -- 2.47.3