From 4c7de07481080d19c7c22a8437184c515ebaeafb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 14 Jan 2012 01:54:02 +0100 Subject: journal: handle empty syslog identifier properly --- src/journal/journald.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/journal/journald.c b/src/journal/journald.c index 39263bfe4c..f63a12fae8 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -1405,10 +1405,14 @@ static int stdout_stream_line(StdoutStream *s, char *p) { switch (s->state) { case STDOUT_STREAM_IDENTIFIER: - s->identifier = strdup(p); - if (!s->identifier) { - log_error("Out of memory"); - return -ENOMEM; + if (isempty(p)) + s->identifier = NULL; + else { + s->identifier = strdup(p); + if (!s->identifier) { + log_error("Out of memory"); + return -ENOMEM; + } } s->state = STDOUT_STREAM_PRIORITY; -- cgit v1.2.3-54-g00ecf