mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
log-context: Don't add log context if value is NULL
This avoids if conditions at the callsite which mess up stack based lifetimes.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user