From: Lennart Poettering Date: Sat, 14 Jan 2012 00:54:02 +0000 (+0100) Subject: journal: handle empty syslog identifier properly X-Git-Tag: v39~55 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c7de07481080d19c7c22a8437184c515ebaeafb;p=systemd journal: handle empty syslog identifier properly --- diff --git a/src/journal/journald.c b/src/journal/journald.c index 39263bfe..f63a12fa 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;