summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-14 01:54:02 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-14 01:54:33 +0100
commit4c7de07481080d19c7c22a8437184c515ebaeafb (patch)
treeb135b26cc833149b6250ec9f58f53ce4a7ffd4d1 /src
parent5c3759bf8a3d418fa877e6a278f3150f404745b2 (diff)
journal: handle empty syslog identifier properly
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald.c12
1 files 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;